[pygtk] check button state continuously
Karsten Henke
henke at robolab.de
Fri Sep 29 22:24:58 WST 2006
Steve McClure schrieb:
> On Fri, 2006-09-29 at 08:54 -0500, skip at pobox.com wrote:
>
>> Karsten> But because the move_robot function is critical, i wanted to
>> Karsten> have some security if the release event got lost.
>>
>> It doesn't appear the Button widget exposes its pressed state via
>> properties. I think you'll just have to assume the released signal is sent
>> and caught. If there was you could recast move_robot as
>>
>> def move_robot(self):
>> # do a little dance ...
>> # make a little love ...
>> # get down tonight!
>> # get down tonight!
>> if self.move_button.state_is_pressed():
>> return False
>> return True
>>
>> (The "return True" was missing from the first version. Without it, the
>> timer will be cancelled after the first call. I was too intent on the "do a
>> little dance" comments I guess.)
>>
>> Skip
>>
>
> And you can probably reasonably assume that if for whatever reason the
> event was "missed" the button state would never be updated anyway as the
> network is still the transport for that activity too.
>
>
So in GTK there is no possibility to check the mouse-button (if it is
released). I have to use a lower layer if i want to get the button
released event? Can anyone suggest some reading how Events in GTK are
created and how the infos (Button pressed and released) are checked?
Thx for your help
More information about the pygtk
mailing list