Em sex., 20 de dez. de 2024 às 14:26, Alexandre Torres Porres <porres@gmail.com> escreveu:I see hcs/cursor is able to change and override the cursor. Will have a look at it...The [cursor] object was a good way for me to investigate and find a solution, but it wasn't a solution in itself. It does change/overwrite the default cursors for Pd, but this strategy wasn't really working for me.For the record, here is my finding: you can simply and easily change the cursor of a clickable GUI object by doing something like
pdgui_vmess(0, "^r rs", x->x_cv, "configure", "-cursor", "pirate");
in your "w_clickfn" function, where "x_cv" is the current canvas. By doing the above in my [knob] object, I get a cute pirate whenever I hover the mouse on top of it. As soon as the mouse button goes out of the knob area it restores to "normal" and it works as expected when hovering over a "bang" object or something. I wasn't expecting nothing this easy :)With more sophistication, I think I can specify different cursors by checking the area that the mouse is hovering on, like being able to use a double horizontal arrow to resize the object. In Cyclone there was a much more complicated structure to do something like this for the old Scope~ object. We improved some things but the same structure was there and it involved creating a new "window" widget and... whatever... too complicated, I think I can simplify this much more now and will do the same for my ELSE objects. I will report back if I don't succeed or something.As for the 'edit mode' status awareness, I have my old solution and haven't found any better new solution and I might open a feature request soon proposing an "edit" message (much like the "zoom" message) to send to objects. If you think I shouldn't bother with that suggestion for some reason, let me know.cheersHence, Pd has hardcodedEm qui., 19 de dez. de 2024 às 22:38, Alexandre Torres Porres <porres@gmail.com> escreveu:Em qui., 19 de dez. de 2024 às 03:02, Alexandre Torres Porres <porres@gmail.com> escreveu: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...Ok, I see now this is taken care in canvas_doclick, which can set the cursor to "resize" in some cases. Things seem to be clearer now to me.But I also see now that it's all quite hard coded into Pd and impossible to expand it to externals. A GUI external could benefit from setting another cursor, such as "bottom_side" for a custom dropmenu button, or "plus" to tell you that you can add a segment into an envelope generator, etc.Using the canvas_setcursor function into a w_clickfn call doesn't work to override the cursor. I can't think of a simple solution like I did by suggesting a new "edit" message in my last email. Nonetheless, I think this would be a nice feature that it's worth discussing.cheers