Closing an application



Sir,
I am trying to ascertain the "exit" method  from an 
application.In the following application, I have
defined an event for the button and connected it with
signal gtk_main_quit. I have not defined this
function, separately. I am relying on the
system_provided function for this.

I have two questions.

1) Is it a proper method of exiting an application?
2) Which function call should I use in the button
event, out of the two choices avilable, namely
"gtk_exit" and "gtk_main_quit"?

Here is the code, that I am using.

#include <gtk/gtk.h>
int main(int argc, char *argv[])
{
 GtkWidget *window;
 GtkWidget *button;

 gtk_init(&argc, &argv);
 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

 button = gtk_button_new_with_label("Quit"); 
 gtk_signal_connect(GTK_OBJECT(button), "clicked", 
                   GTK_SIGNAL_FUNC (gtk_main_quit),
NULL); 
 gtk_container_add (GTK_CONTAINER(window), button); 
 gtk_widget_show(button);

 gtk_widget_show(window);
 gtk_main(); 
 return 0;
}
bye
shiraz


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]