Sunday, August 29, 2010

Working with the mouse cursor.

Because I don't have much time to work on Gnocl today I thought that I'd tackle something simple, something that could he hacked in half an hour. Hence a new command - gnocl::pointer. This command enables the mouse pointer to be manipulated from a script so that its coordinates can be explicitly set or incremented. It will also mean that custom pointer can be set too. 

Here are the options so far from my test script which I think speak for themselves.

gnocl::pointer warp -x 100
gnocl::pointer warp -offset {-200 100}
gnocl::pointer warp -x 100 -y 400

The control code has also been put in place for a new and quite odd sub-command for gnocl::pixBuf, get pointer <widget-id>. Odd, I know, but perhaps someone sometime in the future will want to make custom cursors which are modifications of the basic set, perhaps adding co-ordinates as in some design packages or a question mark for a help or query system. Adding such features are a breeze in Tcl and, after that's the philosophy, 'Tool Command Language'.

No comments: