Em sex., 8 de nov. de 2024 às 21:46, Alexandre Torres Porres <porres@gmail.com> escreveu:
Em qua., 6 de nov. de 2024 às 14:14, IOhannes m zmölnig <zmoelnig@iem.at> escreveu:
Getting the edit mode, should be easy enough:
<https://github.com/pure-data/pure-data/blob/c2d65103e5c068fa466260480b012ef03aed58a2/src/g_editor.c#L2254>

hi, by printing on this code I see this can give me  the edit status but not immediately when getting into edit mode. On the other hand, the comment box responds immediately to the edit status and shows the sidebar handle.

With the help of github's AI (copilot) and to the best of my knowledge, the canvas_editmode function in g_editor.c is what responds to the edit mode status change, and then it uses

text_drawborder(ob, x,
                                rtext_gettag(y), rtext_width(y), rtext_height(y), 1);

to change how things are drawn if in edit mode or not.

I'm yet to better understand how setting cursor works, and I'm also thinking how to expanding this to iemguis, so they can also be resized in edit mode...

But first, I ask, could we have a simple function call to grab the edit status in external objects? My hacky to listen to canvas messages way works, but I was hoping for something better and easier, for everyone to use with externals. Something like a "zoom" message that we can receive.

What do you say?

cheers