[gtkada] Widget destruction problem

Keene, Glenn Glenn_Keene at mail.crc.com
Thu Jan 25 17:13:08 CET 2001


Thanks, you got me working on it again and I think I solved the problem.
Here is my original code. Sim_IF_Window is what I was calling Window B in my
earlier message.
This shows the callback procedure for the "Add" button in Window A. What I
found was that I need the line; "Gtk.Main.Main" added after the "Show_All"
call and it now closes out when destroyed without closing Window A.
---------------------------------------------------------
procedure Sim_IF_AddButton1
     (Object : access Gtk.Button.Gtk_Button_Record'Class)
   is
      begin
    
         Gtk_New (Sim_IF_Window);
         Show_All (Sim_IF_Window);

   end Sim_IF_AddButton1;

----This is the "Cancel" button callback for Window B-------------------

procedure Sim_IF_Cancel_Button
     (Object : access Gtk_Button_Record'Class)
   is
   begin
      Gtk.Widget.Destroy_Cb (Sim_IF_Window);
   end Sim_IF_Cancel_Button;


-----Original Message-----
From: Emmanuel Briot [mailto:briot at gnat.com]
Sent: Thursday, January 25, 2001 5:48 AM
To: gtkada at gtkada.eu.org
Subject: Re: [gtkada] Widget destruction problem


Keene, Glenn writes:
 > I have a widget (Window B) that is instantiated from an "Add" button in
 > another window (Window A) I am adding functionality to the buttons on the
 > newly created Window B. I have added the following call to the
 > "Cancel_Button" callback procedure on Window B:  "Gtk.Widget.Destroy_Cb
 > (Window B)". This works fine to destroy Window B. The problem is once
Window
 > B is destroyed, Window A goes away. I do not want Window A to be
destroyed
 > only Window B.  Any solutions?


There is no reason why A should go away given your description, so there
might
be another problem in your code itself. Send an extract of your code for the
"Add" callback, as well as the one for the "Cancel" callback, perhaps
someone
on the list will be able to see something wrong.

Emmanuel

_______________________________________________
gtkada mailing list
gtkada at gtkada.eu.org
http://gtkada.eu.org/mailman/listinfo/gtkada




More information about the gtkada mailing list