Re: Gtk execution question



On Tue, 12 Nov 2002 lorenzo zampese electrolux it wrote:

> How do I make a sort of "wait" which test a variable value,
> for continuing normal gtk execution ?
> 
> For example :
> 
> -----------------------------------------------------------------
> 
> void HANDLER_file_select_button_ok( GtkWidget  *w,
>                                     GtkFileSelection *fs )
> {
>       my_test_variable= 0;
> }
> 
> ....
> ....
> 
> /* create a file selection dialog */
> wfs= gtk_file_selection_new("Open existing file");
> 
> /* connect handler "HANDLER_select_file_button_ok" to the
>    "OK button" of the file selection dialog*/
> g_signal_connect( G_OBJECT( GTK_FILE_SELECTION(wfs)->ok_button ),
>                   "clicked",
>                   G_CALLBACK( HANDLER_file_select_button_ok), wfs );
> 
> /* show the file selection dialog */
> gtk_widget_show(wfs);
> 
> /***************************************************************/
> /* HERE I would like to stop gtk execution while the OK button */
> /* of the file selection dialog is not pressed,                */
> /* but GTK execution go on and makes the                       */
> /* following 'window widget'  :(                               */
> /***************************************************************/
> 
> /* follow code which make and show another widget */
> window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> gtk_widget_show(window);

How about putting that "gtk_widget_show(window);" into your callback?

Also, I assume you're calling into gtk_main() even though you didn't 
show it.  You never really want to "stop" GTK execution, since it
has to be running in gtk_main() (or a custom loop) even for your
dialog to work.

-Jamie




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