Problem with Thread to create a window



Hello,

I have one problem with GTK+ :

I have on application who run with different Threads.
Every Thread read an input.

I would like that:

When a thread detect an error on input it appear a
"MessageBox" to indicate this error.

1) But if I create the "MessageBox" with the thread, I
have this error :

	"WARNING **: g_main_iterate(): main loop already
active in another thread"

2) So I use the function signal(SIGUSR2, test);

Define in function main()
And just after I use the function getpid()

When my thread detect an error it emit the signal
SIGUSR2 with:
kill(pid, SIGUSR2);

And in my callBack test(), it create my MessageBox.

I have the same message :

	"WARNING **: g_main_iterate(): main loop already
active in another thread"

3) So I have incule the source code of g_main() and
gtkmain() in my project
Then I rename the main function gtk_main_adapted()
And I use a flag.

My thread set the flag to '1'

And in the main loop I test

if(flag == 1)
  MessageBox()

In this case I dont have the message WARNING, but my
error window appear only when I have an other event on
the main window.

For instance : I press a key, or I change the focus on
the mouse...

What is the solution????




=====
oO0 A + Ju 0Oo

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



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