I need a two page message for a help button, so I have the callbackon the window's right upper edge closes the dialog.
procedure Help (Self: access Gtk.Button.Gtk_Button_Record'Class) is
begin
Show ("Page 1");
Show ("Page 2");
end Help;
where
procedure Show (Message: Glib.UTF8_String) is
Dialog : Gtk.Message_Dialog.Gtk_Message_Dialog;
Response: Gtk.Dialog.Gtk_Response_Type;
begin
Gtk.Message_Dialog.Gtk_New (Dialog,
Parent => Parent,
Flags => Modal,
The_Type => Message_Info,
Buttons => Buttons_Close,
Message => Message);
Response := Gtk.Message_Dialog.Run (Dialog);
Gtk.Message_Dialog.Close (Dialog);
end Show;
The problem is: When the first dialog's Close button is pressed, the next page appears, but the first is not closed. When the second page's Close is pressed, the window disappers, but the first dialog window is still there. Only pressing the red cross
What's wrong with my code?
You must call Destroy on the dialog to kill its window.Thanks, Dmitry, that worked.
P.P.S. Modal dialogs is the root of all evil...Whar else would you recommend?
Dmitry A. Kazakov schrieb am Mittwoch, 8. September 2021 um 17:02:52 UTC+2:
You must call Destroy on the dialog to kill its window.Thanks, Dmitry, that worked.
P.P.S. Modal dialogs is the root of all evil...Whar else would you recommend?
On 2021-09-08 19:09, AdaMagica wrote:
Dmitry A. Kazakov schrieb am Mittwoch, 8. September 2021 um 17:02:52 UTC+2:
I do not like dialogs because they cover other UI elements and require switching user attention.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (3 / 13) |
Uptime: | 64:55:59 |
Calls: | 8,355 |
Calls today: | 15 |
Files: | 13,159 |
Messages: | 5,893,946 |
Posted today: | 1 |