comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Button behaviour (action during the click action)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Button behaviour (action during the click action) [message #70745 is a reply to message #70742] Fri, 30 April 2010 19:35 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/30/10 8:11 pm, nata wrote:
> Hi guys,
>
> I need a button with the following behaviour: The user will click the
> button and an event has to be created during the click action. When
> the mouse click is released, the event has to finish.
>
> I'm trying to do that with CW_BGROUP and WIDGET_BUTTON but I realize
> that the events are produced when the button release so I can't
> control the event as I want.
>
> Do you know how can I implement this kind of events ? I want to do
> something while the button is pressed. When the click action finishes,
> my action will stop.
>
> Suggestions ?
> Thanks in advance,

I don't think this is not as simple as it might sound. Check the
PUSHBUTTON_EVENTS keyword to WIDGET_BUTTON. This will allow two events
to be generated: one for the press and one for the release.

But if you just start some event handler after the button push, you will
not receive the button release event until the event handler is finished
(which would be bad since the event handler doesn't want to finish until
the release happens). One way around this is to have some timer based
strategy where the event handler sets a timer when the button is
pressed: every time the timer goes off an event handler is called
(checking first to make sure the button has not been released yet), a
little bit of work is done, and then the event handler exits.

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Previous Topic: Closing a widget nicely
Next Topic: Re: Closing a widget nicely

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Dec 03 16:15:21 PST 2025

Total time taken to generate the page: 1.84320 seconds