[PD] how to change the cursor icon (tcl)

Liam Goodacre liamg_uw at hotmail.com
Wed Mar 7 05:57:36 CET 2018

Several months later, and I've worked out an enhancement on Federico's system for changing the cursor icon.

The one limitation with the file Federico uploaded was that you had to minimize the window (vis 0) after resetting the cursor, or else it would fail to flip the icon when you entered edit mode. I've managed to fix this by modifying the hexadecimal canvas symbol. [canvas_name] gives you a symbol that looks something like "xxxx.c" ; if you just remove the " .c " from the end, then you can change the cursor and still enjoy normal behavior in edit mode without having to minimize the window.

Just posting this for the record, in case it's useful to anybody.
From: Federico Camara Halac <camarafede at gmail.com>
Sent: 26 September 2017 21:21
To: Liam Goodacre; Pd-List
Subject: Re: [PD] how to change the cursor icon (tcl)

Hi Liam (back to the list now ;)

You can trigger the cursor change from a subpatch or abstraction, it doesn't matter, as long as you are in the same pd instance and the canvas_name symbol for the target is visible.

I attached a patch where this is working from inside an abstraction with a metro (needs hcs).

 I don't know of any other way to change the cursor type other than sysgui and configure -cursor. Also I don't know what you mean by pdsend finished. I guess in the end this might be system dependent and probably a tcl version thing that I simply don't know ;) all my knowledge here comes from hacking through this amazing code

either I don't understand your problem or itseems to be working as far as i can see.



On Tue, Sep 26, 2017 at 3:28 PM, Liam Goodacre <liamg_uw at hotmail.com<mailto:liamg_uw at hotmail.com>> wrote:
Yeah those are the kinds of problems that I've been facing. Ultimately, I want to trigger the change from a hidden canvas, ie. inside a canvas. I'm also finding that it seems to work only if triggered by a "click" (of a bang or message box). Trying to automate the process, ie. with a metro, mysteriously fails. (I think this is something to do with the "pdsend finished" message I mentioned previously).

Is there any way around these problems, or is this a lost cause?
From: Federico Camara Halac <camarafede at gmail.com<mailto:camarafede at gmail.com>>
Sent: 26 September 2017 19:46
To: Liam Goodacre
Subject: Re: [PD] how to change the cursor icon (tcl)

Hi Liam, using hcs, I imagine you can use something like this, but it doesn't seem to work all the time. The canvas needs to be visible. Moving the mouse in an out of the canvas triggers the new cursor on mac at least.

[canvas_name]  (  the target canvas )
[$1 configure -cursor hand(        (or whatever cursor name<https://www.tcl.tk/man/tcl8.4/TkCmd/cursors.htm>)

On Tue, Sep 26, 2017 at 1:33 PM, Liam Goodacre <liamg_uw at hotmail.com<mailto:liamg_uw at hotmail.com>> wrote:

I'm looking for a reliable way to change the cursor icon, ie. from an arrow to dot or something else.

The [cursor] object in the hcs library does just this, but it gives a nasty tcl error when triggered inside an abstraction. I don't imagine that this library will be updated any time soon, so I've been looking for alternatives.

There ought to be a raw tcl messages which can be sent to [sys_gui] (also hcs library). I've found one which is promising:

set ::cursor_runmode_nothing "left_side"

But I'm running into difficulties with this also, as it seems to expect a "pdsend xxx finished" message, where xxx is some hexadecimal that I can't work out.

Does anybody know how to make this work?


Pd-list at lists.iem.at<mailto:Pd-list at lists.iem.at> mailing list
UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180307/9f908812/attachment.html>

More information about the Pd-list mailing list