dolik.rce Messages: 1756 Registered: August 2008 Location: Czech Republic
jerson wrote on Sat, 23 October 2010 18:22
Can someone point me to a callback for button which does the following
WhenPush - I know this one
WhenRelease - does this exist?
WhenAction is called when the mouse button is released above the button widget. If you also need to detect when user moves the mouse pointer out of the widgets area (which you probably want, otherwise your I/O pin would stay in high state), then you can either inherit from Button and overwrite MouseLeave() to take care of that. Other solution (without making your own class) might be some ugly use of WhenRepeat with timecallbacks setting turning the state of pin after some time unless another WhenRepeat is called, but that would be ugly and error prone.