comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Gtk.Message_Dialog
Date: Wed, 8 Sep 2021 06:52:13 -0700 (PDT)	[thread overview]
Message-ID: <296e83e5-5855-4732-94ba-ed9c05f3dd6dn@googlegroups.com> (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?

             reply	other threads:[~2021-09-08 13:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 13:52 AdaMagica [this message]
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
replies disabled

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