Re: interrupting gtk_main



Am Sa, den 01.05.2004 schrieb Marisa DeMeglio um 08:02:
Hi,

I am writing a GUI for an application whose events are
controlled by both the end user and a server-type
structure.  This server-type structure notifies the
GUI of new data by calling a class function.

My problem is that gtk_main() takes over and my
program  never receives anything until gtk_main_quit()
[at which point any new data is useless].

Is there a way that I can specify that a certain
function should have the authority to interrupt
gtk_main()?  I want gtk to listen for button presses,
etc, during the program execution, but I also want to
stop and update a text field when I get an outside
signal to do so.

I've looked at some of the examples which use
gtk_main_iteration(), but I'm not really sure how I
would use it here.

It is possible and well done since GTK+1.x, which I#m using:

Have a look at the API docs (GTK+/GDK Reference Manual, chapter
"General") and the tutorials:

function names

        gtk_main_iteration_do

        gtk_timeout_add
        gtk_idle_add

        gdk_input_add

may help you searching.

I'm using the last one to listen for event of a controller board with
attached keyboard, this works perfectly well.

HTH,
Marc





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