Re: [gtk-list] Re: problem with threads and toggle button



Hi,

Thanks for the interest :-)

The problem is not with starting the thread, but more with joing the
main thread of gdk. The thread is started on mouse release, because then
is caled the togled, from what I know (and see at runtime). The lock
appear in this situation:

- while the threaded function is computing, the pause is enabled. 
- when the thread is stoped, it disables the pause button
- if I press the mouse while the thread is running _and keep it pressed
till the thread ends_ I get a lock.

I do not understand very well what's creating the lock because I also
set the state to the pause to toggled (checked) and that's not creating
any problem.


An by the way, the program is not a CD player, just a UI that controls
my simulation. I suspect I can do what you suggest, but when I started
the design (and still now) I considered much more expressive to have two
separate buttons, one for start and for pause.

You can find some more infos about it here:

http://borco-ei.eng.hokudai.ac.jp/~borco/scientific/

Ionutz

PS: what I can do to avoid this problem is to use the pressed event to
handle the pause button. But this is not very consistent with UI, as
usually you have to wait the release. Using the pressed signal would
solve my problem, I have to admit, but it would make my app very
unstandard, at the same time :-/

Edward March wrote:
> 
>         Can you use the mouse release to start the thread ?
>         if you have pause pressed down already seem like the
>         thread should stop and perhaps wait for a mouse leave pause
>         button event ? after all it cant start until the start button
>         is pressed right ? so you would have to leave the pause!
> 
>         may life would be simplier with one button named
>         Start and renamed to pause by the running thread.
>         can you rename on the fly w/o problems ??
>         start on the button rlease, rename the button and wait for
>         another press and release, same buttons toggles start/pause

-- 
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]