[gtkada] "delete_event" / close a window/app properly
Thomas De Contes
d.l.tDeContes at free.fr
Mon Feb 7 09:31:51 CET 2005
hi :-)
i got some source code, i don't know if this part was made by glade or
by my coworker :
Return_Handlers.Connect
(Win_Principale_gpi, "delete_event",
Return_Handlers.To_Marshaller (Win_Edeb_Hand'Access));
function Win_Edeb_Hand
(Widget : access Gtk_Widget_Record'Class;
Event : Gdk_Event) return boolean;
function Win_Edeb_Hand
(Widget : access Gtk_Widget_Record'Class;
Event : Gdk_Event) return boolean
is
begin
if Message_Dialog ("voulez vous vraiment quittez edNet ?",
Confirmation,
Button_Yes or Button_No, Button_Yes) = Button_Yes
then
some work;
Gtk.Main.Gtk_Exit (0);
end if;
return true;
end Win_Edeb_Hand;
well, it should not use Gtk.Main.Gtk_Exit, and return the result of the
dialog instead of true, isn't it ?
it would exit the application, closing the window ?
btw,
is there somewhere an example of application which can open several
main windows, as does Open Office ?
(on the native mac interface it's easier, since the thinking of
"windows" are separate from the "applications" !)
More information about the gtkada
mailing list