[Q] Move the cursor programatically
Ned Konz
ned at bike-nomad.com
Sun Sep 7 22:13:11 UTC 2003
On Sunday 07 September 2003 09:42 am, Ned Konz wrote:
> On Saturday 06 September 2003 05:15 pm, Martin Drautzburg wrote:
> > What is the best way to warp the cursot to a dialog I just opened
> > ? (other than moving the mouse of course).
>
> You don't. You move the dialog to the mouse.
You can just look at the position of the pointer, and translate your
dialog's bounds so that it's underneath the pointer (if possible).
Something like:
| newBounds |
newBounds := self bounds translateBy: (ActiveHand position -
myOKButton center).
self bounds: (newBounds translatedToBeWithin: World bounds).
self openInWorld.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|