Advertisement

overriding Motif / GTK+ main loop

Started by October 24, 2004 03:26 AM
1 comment, last by C-Junkie 20 years, 1 month ago
Hello I'm using Xlib (glX) for a larger scaled application that requires me to have my own (self-written) main loop. But I however require some kind of non-application-internal UI. I was thinking about Motif/Xt or GTK+, but they both require me to call their mainloop-function, which opens a forever-loop, and thereby don't make me able to continue with my own stuff. Is there a possibility to do all the drawing / eventprocessing in an own function, or do I NEED to call the mainloop function of the API ( Motif / gtk )?
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
You can single-step the GTK+ main loop using gtk_main_loop_do with blocking set to FALSE.
Advertisement
Depending on what kind of processing you need to do, you might be able to teach gtk's (actually glib's i believe) main loop to understand what to do with it.

For example, it's fairly easy to assign a function to be called whenever there is data to be read from a socket. Grab the source for netapplet to see a good example of this.

If you're talking about rendering 3d graphics or something, then yeah, you can use (naughty naughty!) gtk_main_iteration_do.

This topic is closed to new replies.

Advertisement