Replies: 20 comments 49 replies
-
i think, ideally the syntax would be closely modelled after how objects are stored on the disk. e.g.
|
Beta Was this translation helpful? Give feedback.
-
As a note, in order to take further advantage of the testing I tested here, it would be extremely helpful to have a place where all the final (after conversion)Tcl/Tk messages are logged, so that we can automate the process of verifying we didn't break anything. |
Beta Was this translation helpful? Give feedback.
-
@giuliomoro I think it should be more like 1. (e.g. draw bang here, draw text object w/ inlets: {signal, message, message, signal} and outlets: {message, signal, signal} etc.) |
Beta Was this translation helpful? Give feedback.
-
Many GUI objects can hide their I/O so passing that may still be needed for them.
|
Beta Was this translation helpful? Give feedback.
-
This falls into the question of where certain GUI state aspects should sit, ie. is the logic for deciding I/O for IEM GUIs better handled on the GUI side or in the core. I lean toward the core and keeping state in one place and standardizing I/O as part of a message makes sense here. In cases where it’s ignored, passing 0 would be fine.
|
Beta Was this translation helpful? Give feedback.
-
One issue specifically with I assume there will be similar issues for other objects. For instance, [hsl] and [vsl] need to know exactly where the mouse cursor is with respect to the 'knob' in order to properly handle "jump on click" or "steady on click". If the GUI tries to customise the look in such a way that e.g.: a few "padding" pixels are added inside the rectangle that was prescribed by the core, the functionality's behaviour may be affected. Last, other "subshapes" such as outlets and inlets must be located at a very specific place (with no flexibility left to the GUI for deciding where to draw them) in order for both cursor changes on hover to happen appropriately and for patching to work at all. So, how is consistency of shapes / sub-shapes between core and GUI ensured when the details of the shape itself are offloaded to the GUI? Should the GUI send back to the core the details of the shape / subshapes it drew so that the core is aware of them? |
Beta Was this translation helpful? Give feedback.
-
I agree. Anything beyond a hit-box is probably beyond what Pd needs. In interaction-based works, I generally only use distance circle or hit box checking because they are fast and simple to write.
… On Sep 2, 2022, at 1:05 PM, umläute ***@***.***> wrote:
it should be possible to extend this to any (polygon) shape, but OTOH i'm not sure it's actually worth it (see my observation above, that any cut-outs are purely cosmetic).
hit-box detection in an arbitrarily shaped polygon is much more complicated than within a rectangle...
if a widget adds decoration (e.g. a nice frame around the slider), i would expect this decoration to be "dead" (from Pd's POV) and the actual "active" area is what Pd thinks it is.
--------
Dan Wilcox
@danomatika <http://twitter.com/danomatika>
danomatika.com <http://danomatika.com/>
robotcowboy.com <http://robotcowboy.com/>
|
Beta Was this translation helpful? Give feedback.
-
Personally, I would really like to have the possibility for third-party GUIs to perform their own collision detection, therefore I think the actual GUI message refactoring should be designed in such a way that Pd's collision detection system can be circumvented. We shouldn't leave this big chance on the table! Generally, I agree with others that the core should not need to know the exact shape of the object. However, @giuliomoro brought up a very important point regarding hslider/vslider (and related widgets). Here the object hitbox does not offer enough information, e.g. because of padding inside the object. That's really something to think about! |
Beta Was this translation helpful? Give feedback.
-
macos here, the cursor changes when you hovering over the floatatom (in non-edit mode): I had done a quick test before posting and it seemed that the cutout was excluded from hit detection, but upon second inspection it actually is included, sorry for the false alarm. And I can confirm that msg boxes will not consider the horns to be part of the active region.
This makes a lot of sense as that seems to be exactly what Pd is doing right now, no reason to make things more complicated. Rectangles only.
It probably needs to send back information about individual inlets/outlets as well, right?
It seems that if the GUI sends back to the core the shape of the created shape and sub-shapes, then we would only need to add a "hit_triggered" message back to the core. If a GUI wants to handle all (or only some!) of the hit detection, it could simply send back empty shapes to the core and instead send |
Beta Was this translation helpful? Give feedback.
-
It would be really nice to have all of the hit detection/ui geometry/metrics offloaded from the audio thread for performance reasons too.. maybe in the distant future some non-blocking memory allocation system can be implemented too and pd will be able to be used for live patching without blocking the audio thread for geometry processing or memory allocation.. |
Beta Was this translation helpful? Give feedback.
-
I have done a first pass at implementing some tcl procs to move away from passing tk commands. It is my first time at tcl and I don't have a deep understanding of the inner works of Pd, so please bare with me if anything about the style is not ideal. I The code can be found here https://github.com/giuliomoro/pure-data-1/tree/1695-tests I made a few NIT commits to begin with which helped me minimse the Throughout, I have been testing this with my pure-data-gui-testing, whose test patch has been extended to include coverage to all (I think) the tcl calls that have been affected by the commits on this branch (incl e.g.: deleting, selecting and moving objects). Where appropriate, I added workarounds in the tcl code to ensure that the tcl command being generated is exactly the same as in the code I am comparing against (a2f07d9). These can be removed at a later date. What has been migrated:
I tried to stay reasonably close to the existing C functions. This means that I have all of the following procs on the tcl side: config create delete iemgui_label_font iemgui_label_pos move select update. This could surely be rationalised further (e.g.: config and update I think are only iemgui-specific). However in some cases I rationalised it a bit more. E.g.: I am currently not following the recommendation above
This is in the first instance because I tried to keep the same argument order as the Before doing any further work, I wanted to stop and check in first. Feel free to comment on all of this and the code: this was mostly a time-limited attempt I made in order for me to better understand the issues at hand, but I am not strongly attached to any of the code I wrote. I thought I'd make a comment here instead of opening a PR because this is veeery far from being mergeable and this is more of a contribution to the discussion that is ongoing here, but let me know if a PR would be a better approach for this and I can do that. |
Beta Was this translation helpful? Give feedback.
-
True. I use the UIView hit detection methods in PdParty but honestly I’d be very happy to drop all of that and let Pd do it for me. However, I only every sought to emulate the existing widgets.
|
Beta Was this translation helpful? Give feedback.
-
Note: we would probably still need primitive drawing for data structures to some degree.
|
Beta Was this translation helpful? Give feedback.
-
For Bela it would be very convenient (if not a requirement) to have the IDE running inside a browser. We are considering using svelte to do that, which is under MIT license. For a Pd-GUI, this GUI code may be used and displayed in an Electron app or similar. What are your thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
I think it’s Electron, yes. In any case, we want to make it easier to integrate Pd with all sorts of GUIs, Electron included, so I don’t see a need to digress.
|
Beta Was this translation helpful? Give feedback.
-
As a thought experiment I'm thinking what it would take to adapt Pd to use GTK (which seems the most durable open-source GUI package out there; QT would be another possibility but it doesn't look free enough). |
Beta Was this translation helpful? Give feedback.
-
If I understand this right, this would be getting rid of tk-isms like "-width" and backslash-escaping, so for instance set ::sys_searchpath {{/home/msp/class/170/m170-function-library-v10} } ; would become set_search_path /home/msp/class/170/m170-function-library-v10 and
by
or something like that, correct? |
Beta Was this translation helpful? Give feedback.
-
PS yes, keeping the logic in the core will make it much easier to make future adaptations when GUI packages come and go. |
Beta Was this translation helpful? Give feedback.
-
That's not too far from the extensive work that @umlaeute has been doing in #1765.
One of the leading principle behind #1765 was: keep the commands as valid tcl commands, but simplify and abstract them enough that they can be easily parsed and interpreted by "any" frontend language. The current implementation assumes that types are agreed upon as part of the message type (e.g.: |
Beta Was this translation helpful? Give feedback.
-
I think that's right, we don't need the type-strings since the functions themselves will know what type arguments they expect. |
Beta Was this translation helpful? Give feedback.
-
This is research/brainstorming for refactoring the communication between the Pd core and the GUI to remove Tcl/Tk code from the core. see #1693
Note: This is not a full, open rewrite away from Tcl/Tk but a refactor and abstraction to allow for implementing custom GUIs without worrying about Tcl-specifics. Also, this current work maintains the editing logic within the core.
Please keep the discussion focused on technical considerations. This is not meant to be a GUI feature wish list!
currently, the Pd-core constructs Tcl/Tk drawing commands like this:
instead it should issue a command that is oblivious of the actual drawing:
this is still a valid Tcl/Tk command (even using typical Tcl/Tk constructs like dash-arguments (
-width
)), but should be easy to parse to be used by any GUI backend)Beta Was this translation helpful? Give feedback.
All reactions