The proper way of catching mouse button events from a draw widget? [message #50793] |
Wed, 18 October 2006 05:14 |
Braedley
Messages: 57 Registered: September 2006
|
Member |
|
|
In many of my programs (be it command line or widgets), I often need
the user to enter a bounds of a particular graph by clicking on it.
With basic windows, it's just using cursor like so:
cursor, x1, junk, /data
plots, [x1, x1], !y.crange, /data, color=254 ;color=red
cursor, x2, junk, /data
plots, [x2, x2], !y.crange, /data, color=254 ;color=red
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. 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?
Braedley
|
|
|