Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-05

OpenDialog

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sergio A. Kessler
Shane Miller wrote
I looked at the new function gtk_window_set_modal( window,boolean) and called it before the gtk_widget_show. I didn't notice any difference with the openfiledialog.

but you put the gtk_file_selection widget within a gtk_window ?

btw, the same is happen here with forms

function TCustomForm.ShowModal: guint;
begin
     gtk_window_set_modal( PGtkWindow( FComponent), True);
     //set_modal( PGtkWindow( FComponent)^, 1);
     gtk_widget_show( FComponent);
end;
Currently, you Execute the opendialog and assign the opendialog.onOK to a procedure. When the user presses OK that procedure gets called. Kind of cool, but not exactly like Delphi.

I think is too complicated.

'if MyOpenDialog.Execute then' is more simple (and delphi compatible)

one solution must be that Execute connect signals and wait in a loop until a signal from the gtk_file_selection come (ok, cancel).

Hmmm, I think this is the cleaner solution ...
In the create of OpenDialog we connect signal (used internally) and in Destroy we disconnect the signals.
In Execute we wait in a loop a signal, and voil�, showmodal and delphi compatible.
(I'm thinking in what happens if the user close the window :)

Sergio

Reply by email