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

Home » Public Forums » archive » Re: The proper way of catching mouse button events from a draw widget?
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: The proper way of catching mouse button events from a draw widget? [message #50792 is a reply to message #50790] Wed, 18 October 2006 05:49 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Braedley writes:

> Reading through the widget_draw documentation, they suggest that cursor
> not be used for this type of thing, but instead use mouse events. This
> is despite the fact that using cursor hasn't caused any problems at all
> in my widget programs.

Well, any problems you have noticed yet. :-)

Typically the reported cursor location is 2-3 pixels off from
where you *think* you clicked. Not a big deal most of the time,
but a HUGE annoyance when you are trying to do things like
select a resizing square or something else that requires
precision pointing.

> However, I would still like to use the proper
> implementation whenever possible. So the question becomes, how do I
> grab mouse events only when I want them, and then return to the proper
> point in the current event handler?

Uh, I'm not sure you fully understand how widget event
handlers work. There is no "returning to the proper
point" in an event handler. Events are one-shot deals.
An event happens, it is handled. If another event occurs
while the first event is being handled, the event gets
queued up so it can be handled when the first event
handler is finished, etc. Events are processed one after
the other, consecutively.

To see how widget events might be used to select the
boundary of a plot, have a look at ZPLOT:

http://www.dfanning.com/programs/zplot.pro

Here the boundaries are chosen by the user clicking
and dragging on the plot. To restore the plot to its
original boundaries, just click and release somewhere
inside the plot.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: filled usersym
Next Topic: database access using JAVA or COM

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

Current Time: Sun Oct 12 00:08:13 PDT 2025

Total time taken to generate the page: 1.35965 seconds