comp.lang.ada
 help / color / mirror / Atom feed
* Gtk.Message_Dialog
@ 2021-09-08 13:52 AdaMagica
  2021-09-08 15:02 ` Gtk.Message_Dialog Dmitry A. Kazakov
  0 siblings, 1 reply; 5+ messages in thread
From: AdaMagica @ 2021-09-08 13:52 UTC (permalink / raw)


I need a two page message for a help button, so I have the callback

  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 on the window's right upper edge closes the dialog.

What's wrong with my code?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-10 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 13:52 Gtk.Message_Dialog AdaMagica
2021-09-08 15:02 ` Gtk.Message_Dialog Dmitry A. Kazakov
2021-09-08 17:09   ` Gtk.Message_Dialog AdaMagica
2021-09-08 19:01     ` Gtk.Message_Dialog Dmitry A. Kazakov
2021-09-10 18:54       ` Gtk.Message_Dialog Mark Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox