problem with threads and toggle button



Hi,

My program have some toggle buttons that can set other buttons depending
on which button is toggled. Some of them can be also disabled. Checking
the run button, a thread is started and soem of the buttons are
disabled, including the run button. The pause button is enabled.

When I click the pause, I can suspend the thread. When the thread stops,
depending of several conditions, it can disable the pause.

Now the problem:

When the threaded function ends, I enter the main gtk loop to set some
of the buttons. i use:
  gdk_threads_enter();
  ....
  gdk_threads_leave();

This work almost always, unless I hapen to do this: keep mouse button
press down in the pause button when the threads ends and the thread
tries to disabled it. If I comment the line (from the threaded function)
that disables the button, then everything works fine, excepting I don't
get the effect I want. 

Any suggestions ? 

TIA,

Ionutz
-- 
Mental backup in progress - Do Not Disturb!
--
http://borco-ei.eng.hokudai.ac.jp/~borco/



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