[lazarus] OpenDialog

Sergio A. Kessler sak at perio.unlp.edu.ar
Tue May 18 18:24:17 EDT 1999




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






More information about the Lazarus mailing list