Hi,
does exist a template for an expandable GOP?
I do this but the controls are not hidden when the switch is set off (they remain visible out of the abstraction box):
Expandable GOP?
Hi,
does exist a template for an expandable GOP?
I do this but the controls are not hidden when the switch is set off (they remain visible out of the abstraction box):
Work in progress : FCPD a FreeCAD PureData connexion
@FFW As far as I am aware there is no good way to determine how deeply nested in the patch an abstraction is. In the past when I have needed this I have used [canvasindex] since it produces no output if toplevel, something like this:
Possibly warrants a feature request on the pd github, results may happen quicker with an iemguts feature request but I am not sure if umlaeute has any interest in extending the features of iemguts but he is quick about dealing with bugs. Probably will not be a feature of vanilla anytime soon since the official way to deal with such things is [namecanvas] and named canvases which covers most use cases. With how things currently stand, numerical depth is more suited to the iemguts workflow than the pd workflow,
Edit: Not completly certain I understood you use case. Do you actually need to determine depth? Is the issue nested canvases? If depth is constant then [iemguts/sendcanvas] will solve your issue. I suspect my post was going the wrong direction and you don't need to worry about depth?
@FFW That one was my bad, I had not looked closely enough at your screenshot before responding. I am not seeing an obvious cause of your issue but a couple things jump out at me and could be troublesome. You are sending two coords messages for EVERY motion event on the parent canvas, put a [change -1] between the [expr] and the [sel 1] so it only does it once when the state actually needs to change. This will also make your expand and shrink methods work as expected, as of now if you send [expend( to the left inlet when the mouse is outside of the GOP it will immediately shrink back down the second the mouse moves, which I don't think is what you want?
Something like this would also be considerably more efficient than your [expr], as you have things now if you had 20 abstractions in the canvas which use this you do the [expr] 20 times for every motion event, that could really add up and cause problems, Did not test this, believe I have the logic right but if I don't it should demonstrate it. Obviously you would want to update x-max and y-max on every expand/shrink.
Adding in the [change] might fix things, pd might be getting confused by all those coords messages you are sending, not sure, no time to dig into it right now.
@oid A realtime
on expr
indicates a 8ms compute time. I'll try with your version.
I've added a change
and a pipe
to delay the switch.
It doesn't fix the comments problem, they only disappear when I save their containing abstraction (or when I reload the main patch).
Now I'm looking for a dynamically added and resized background canvas to get rid of the transparency.
Work in progress : FCPD a FreeCAD PureData connexion
@FFW This seems to work, but I can not quite see why yours does not work and I went through it removing every possible cause I could think of until I had pretty much this same patch, and it didn't work. Patch it together from scratch and it works, so probably something stupid and easy to miss in your patch and we are both missing the obvious. I added a third and fourth argument so you have shrunk width and hight and expanded width and height for args now and left some of the details for you to fill in.
ffw.pd
This seems pretty useful, easy way to make menus and dynamic interfaces, good idea to stick this in an abstraction, never dawned on me to do such a thing.
@FFW said:
And [donecanvasdialog( is worse: all the guis remain visible as ghosts.
With your version or with the one I posted?
Your issue with the seq helpfile is just an error in the helpfile, possibly who ever made it used a custom font which can cause such issues for everyone who uses the default fonts.
@FFW That is because you are not sending 0 to the third argument and then 1 or 2 as I do in mine. Sending 0 to that argument disables GOP then sending 1 or 2 reenables it which tells pd to redraw and the reason for all that extra stuff at the bottom of mine. Try something like this for your minimal test:
This should make it work, donecanvasdialog does the exact same thing as the canvas properties dialog does when you click "ok" or "apply," this is the exact message the tcl/tk frontend sends to the pd core so if your canvas properties dialog works than this should work.
Edit: Fixed some errors in the image, had 1 instead of $1.
@FFW try this, open ffw-test.pd and see if it expands on mouse over and shrinks when the mouse leaves. Restart pd before opening it just in case you have one of those weird things going on caused by a confused instance of pd. This should work,
Archive.zip
Edit: if it doesn't work, what version of pd are you running?
OK got it: setting the "gop mode" to zero is not enough, it has to be set with the large dimensions and then it can be shrink without ghosts.
And then it works with [coords( too.
EDIT: I've fixed it with a list:
Work in progress : FCPD a FreeCAD PureData connexion
Oops! Looks like something went wrong!