intercept nervous button clicks...



Hi,

in my app some actions behind buttons take time, so the button is
released not before the action is done. This is ok.

However, I need to prevent the user from clicking other buttons in the
meantime.

The problem seems to be harder than it looks since gtk can not empty the
mouse click buffer (of ms window in my case) and so, right when the
first button is finally released the next is pressed "automagically"...

I am not quite happy with my strategy (see below), and I am looking for
something easier or more comfortable:

* I tried to write a wrapper for the button create function
* which automatically connects not only the "clicked" but the "pressed"
  and "released" event also
* and calls a thread each time the button is pressed,
* which is stopped with the release event
* but of course with a certain delay
* The thread resets a global boolean flag ("button_blocked=FALSE")
* and so, new button clicks are allowed again.

This, however, only works if I check that global boolean flag in each
button click callback.

I also noticed that clicking again on a already pressed button seems to
skip the "release" event in between (so my strategy won't work in this
case).

Anyone?

 Felix



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