[gtkada] SIGNALS QUESTION

Jacobo Marcos jacobom at navegalia.com
Mon Apr 15 17:04:38 CEST 2002


I'm developing an aplication in gtkada(with glade) and i have a main
window and others dialog windows.

When i click on the upper and rigth button [X] on the frame of the
aplication (MAIN WINDOW) i catch a "destroy" signal and i finish all the
aplication
with an Gtk_Exit(1) procedure, something like that:

   -----------------------------
   -- On_Ventana_Ppal_Destroy --
   -----------------------------

   procedure On_Ventana_Ppal_Destroy
     (Object : access Gtk_Window_Record'Class)
   is
   begin
      Gtk_Exit(1);
   end On_Ventana_Ppal_Destroy;

that's rigth for my application. I want to exit from the app

BUT :
When i click on the upper and rigth button [X] on the frame of a
dialog window i want only to hide this window and when i catch the
"destroy" signal, i do something like:

   procedure On_Selector_De_Fichero_Destroy
     (Object : access Gtk_File_Selection_Record'Class)
   is
   begin
      Hide_All(Selector_De_Fichero);
   end On_Selector_De_Fichero_Destroy;


When i exec. the program in i click in the [X] of an dialog window it
is hidden (or is destroyed, in my opinion) but then when i want to
reopen the dialog the app. finishes and a message is printed the console

raised STORAGE_ERROR : stack overflow (or erroneous memory access)
( in my opinion erroneous mem. access)

I think i have a STRONG problem with the destroy signal an the
effects that causes in a gtk process.
But what i want is:

 - when i click the [X] button of the main window frame EXIT the
   application.
 - when i click the [X] button of another  window frame EXIT the
   window is hidden.

Have i choosen a bad signal to handle, my signal hadlers are wrong
implemented

Excuse me my bad english. Thanks





More information about the gtkada mailing list