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

Federico Camara Halac camarafede at gmail.com
Tue Sep 26 22:21:42 CEST 2017


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.

cheers

fd


On Tue, Sep 26, 2017 at 3:28 PM, Liam Goodacre <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>
> *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.
>
> [bang(
> |
> [canvas_name]  (  the target canvas )
> |
> [$1 configure -cursor *hand*(        (or whatever cursor name
> <https://www.tcl.tk/man/tcl8.4/TkCmd/cursors.htm>)
> |
> [sys_gui]
>
> On Tue, Sep 26, 2017 at 1:33 PM, Liam Goodacre <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?
>>
>>
>> Liam
>>
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/li
>> stinfo/pd-list
>>
>>
>
>
> --
> http://fdch.github.io/tv
>



-- 
http://fdch.github.io/tv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170926/c196bdfb/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main_sys_gui_msg.pd
Type: application/octet-stream
Size: 432 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170926/c196bdfb/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sys_gui_msg.pd
Type: application/octet-stream
Size: 1798 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170926/c196bdfb/attachment-0003.obj>


More information about the Pd-list mailing list