How to move cursor in MVC?
Bert Freudenberg
bert at impara.de
Tue Nov 16 10:15:34 UTC 2004
Am 16.11.2004 um 09:54 schrieb david:
> How to move cursor in MVC? Programmatically? Is it even possible? I
> used "Sensor cursorPoint:" but it did not worked. Is there any other
> way way how to access cursorForm than using the Sensor global
> variable?
"Cursor currentCursor" is the current cursor form.
Sensor>>cursorPoint: is broken, the VM does not support setting the
cursor position anymore.
> I want it for moving points in graph of the function
Well, my first reaction to this would be "use the mouse" ;-)
> and only way I could do it just now is workaround using blank Cursor
> and predending it is moved, calculating difference. So please tell me
> I'm an idiot and show me way it works, please ;-)
I don't quite understand what you want ... move a Form that looks like
a mouse cursor over the screen programmatically (as a demo, maybe) or
do you really need to move the system's mouse cursor?
If the former, you might use something like this:
Cursor blank showWhile: [
Cursor normal
follow: [Display extent - Sensor mousePoint]
while: [Sensor noButtonPressed]]
In the latter case, well, complain to the VM folks to restore the
CursorLocPut primitive. Or do it on your own, via FFI.
- Bert -
More information about the Squeak-dev
mailing list
|