Hi, it has been a week of frustration and search. I
will ask the question without showing code until someone who has time to help me
asks for more detail. You may assume all necessary statements (initialization,
locking) are done as stated in documentation. Here is my problem in general
terms.
I have a rather large application that also draw
some GUI for user input. In Windows, the application continuously checks for
things to do, among them it also checks for any GUI input. If a GUI event is
available, it will process the event in the usual way, and move on to other
things.
I noticed in GTK that gtk_main() locks up the
application, even though the GUI is drawn. So, the obvious solution was to move
gtk_main() to a thread. Notice that the application must create the thread that
contains gtk_main(), unlike examples I found in my searches.
By using thread, I got the following:
gtk_main_quit: assertion 'main_loops != NULL'
failed.
Then, I started to move gtk statements to the
thread, until every gtk statement was in the thread. The application proper does
not contain any gtk statements, it only creates a thread that contains gtk
statements. The statements are nothing more than creating a top window. I still
see the same message.
How is it that the assertion does not fail when the
same statements (minus threading) are in the application, and not in a thread
created by the application? Do I have to create threads using gtk library
instead of p_threads? Does gtk even work with p_threads or there are
issues?
More important, can I do what I am trying to do?
That is, stop gtk_main() from being in control of the etire
application?
Thank you very much for your help.
|