[gtkada] Generating a handler for event of top window with gate

randhol at pvv.ntnu.no randhol at pvv.ntnu.no
Sun Sep 14 13:21:47 CEST 2003


ludovic.brenta at insalien.org wrote on 14/09/2003 (11:02) :
> 
> Hello,
> 
> I am toying with glade 2.0.0 and gate 2.2.0 on GNU/Linux.  I have a
> top level window containing a number of widgets.  The generated Ada
> code compiles and runs just fine, except that the program does not
> return when I click on the window manager's close button.  So, I'm
> trying to add a handler for the delete_event signal.  Here is a
> snippet of my .glade file:
> 
> <?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
> <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
> 
> <glade-interface>
> 
> <widget class="GtkWindow" id="top_window">
>   <property name="visible">True</property>
>   <property name="title" translatable="yes">Top window</property>
>   <property name="type">GTK_WINDOW_TOPLEVEL</property>
>   <property name="window_position">GTK_WIN_POS_NONE</property>
>   <property name="modal">False</property>
>   <property name="resizable">True</property>
>   <property name="destroy_with_parent">False</property>
>   <signal name="delete_event" handler="on_top_window_delete_event" last_modification_time="Sun, 14 Sep 2003 10:05:42 GMT"/>
> 
>   <!-- Here, there are a number of child widgets -->
> 
> </widget>
> 
> </glade-interface>
> 
> 
> My problem is that gate does not seem to generate any handler for the
> delete_event.  It does generate handlers for signals sent to the child
> widgets, however.  Also, glade generates C code with the handler for
> delete_event on the top-level widget, so I suspect this is a bug in
> gate.

In the on_top_window_delete_event procedure (found in the callback file)
have you inserted:

   Gtk.Main.Exit
 
(or is it Gtk.Main.Main_Quit. I'm sorry my computer is broken and I
haven't managed to move my files to the new yet so I cannot check)

Preben



More information about the gtkada mailing list