Waiting for a mouse click

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Waiting for a mouse click

Kai Boellert
Hello,

Suppose I have a view and would like to force the user to click on some
part of the view (e.g. to select something): How do I create a loop in
order to wait either for a mouse button or the ESC key being pressed
(the latter cancels the selection)?

I found the following code snippet in MouseTracker>>initialize:

  SessionManager inputState loopWhile: [ self class capture == self ]

but, as #loopWhile: is a private method, I'm wondering if this is an
appropriate solution for my problem.

Regards,
Kai


Reply | Threaded
Open this post in threaded view
|

Re: Waiting for a mouse click

Ted Bracht-2
Hi Kai,

>
> Suppose I have a view and would like to force the user to click on some
> part of the view (e.g. to select something): How do I create a loop in
> order to wait either for a mouse button or the ESC key being pressed
> (the latter cancels the selection)?
>

Can't you just disable the rest with #queryCommand?

Ted