Re: How to realize button clicked in main function?



 Hello.

 You could try this code in the main function before gtk_main()
            
 
gtk_signal_connect(GTK_OBJECT(Cancel_button),"clicked",GTK_SIGNAL_FUNC(CloseApp),NULL);
   
 where  

gint CloseApp(GtkWidget *widget,gpointer *gdata)
{
	gtk_main_quit();	
	return(FALSE);
}

 is the callback function.

 I'm hoping to be useful.

 Regards.
 Insallah.


jinzhen chen wrote:
> 
> I created a dialog with "OK" and "Cancel" button using gnome. I tried
> to do as MFC:
> 
> if (dialog.DoModal() == IDOK) { // do my work}. But in GNOME I don't
> know how to realize
> 
> it in "main" function after gtk_main (). If you have any idea about
> that, please give me a message. Thanks!
> 
> Stacy
> 
> 
> 
> ----------------------------------------------------------------------
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo!
> Messenger
> http://phonecard.yahoo.com/




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