Re: GtkDialog



Deepa Chacko Pillai <deepa chacko wipro com> writes:
> I have an application which displays some data. I have implemented
> this using GtkDialog. It has 2 buttons - Yes and No. Since I have
> two different callbacks associated with each of these buttons, I
> need to use gtk_dialog_run () to differentiate the response id's
> emitted.  gtk_dialog_run () in my case has to be in the main (), as
> I am creating the GtkDialog here. Now I have problem placing
> gtk_dialog_run () and gtk_main () as both will block waiting for
> events. If I place gtk_dialog_run () before gtk_main (), then the
> dialog box will not be able to get any other event from the X
> server.  How can I get over this?
> 

I don't see the problem - gtk_dialog_run() just enters the main loop,
gtk_main() just enters the main loop also. 

So you do:

 response = gtk_dialog_run ();
 /* handle response */
 gtk_main ();

It should work just fine.

You don't even need to use gtk_main(), it's fine to just use
g_main_loop_run() directly as well.

Havoc



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