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 #50772 is a reply to message #50771] Wed, 18 October 2006 08:54 Go to previous messageGo to previous message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
David Fanning wrote:
> Braedley writes:
>
>
>> I'm well aware of how event driven programming works, so I probably
>> should have been a little more precise. What I should have asked is
>> how would I go about creating a function or procedure that would
>> perform the same action as a call to cursor, but follow the guidelines
>> for draw widgets.
>
>
> Well, presumably you heard that it can't be done. :-)
>
>

I think it perhaps could be... almost:

If we get the user subroutine to supply its own function name and a
magical index to the draw widget event handler then store all it's
variables before returning.

After the draw widget has collected the min and max x-range it can use a
call_function to call back the original function which will take the
index and essentially implement an entry point via a goto and then
restore all the saved variables. It can then carry on with the min and
max x-range.

I think that will pretty much give the same functionality as using an
inline call to cursor. You still need to protect against someone not
clicking on the draw widget twice but presumably the original cursor
calls were open to that as well. I've not used cursor in this millennium
so I don't know what happens if you click on a button when cursor is
expecting some coordinates.

However, my 'solution' is repulsive and there is no way I'm supplying
example code for the above suggested catastrophe. One day far from now
in a job interview someone might put it down in front of me and ask if I
actually wrote it.

I'm also of the opinion that if the above is the way to do it then it's
almost indistinguishable from David's assertion that "it can't be done".
However if you're in the situation where you have code you can't
refactor for whatever reason and using cursor is giving you the wrong
answer then maybe it's easier (but certainly not better) than re-writing
everything to function within how IDL is designed to do such things.

Thanks,

Allan
[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: Sat Oct 11 06:45:58 PDT 2025

Total time taken to generate the page: 1.67846 seconds