[PD] ButtonRelease binding getting lost - was Tcl getting sluggish

Pierre Alexandre Tremblay tremblap at gmail.com
Thu Mar 21 13:12:35 CET 2024


Ok now I hit a strange bottleneck. I hope anyone can help.

1. If I don’t delete the frame, tcl get sluggish like memory leak vibe

1a) I’ve tried
	 	if {[info exists %lx_frame]} {.x%lx.c itemconfigure …
	like I saw in the IEM - to no avail

2. If I delete everything in my draw routine (frame and points) I get happy, but

2a. My mouserelease binding disappears and doesn’t seem to accept rebinding.

I need that for the command-drag-to-zoom ending. During the drag it redraw all right, so the “motion” still gets send, but my redraw deleting the frame on which the original binding was done is delete and recreated and re-bind-ed but to no avail

Now, I’m really stucked. I have tried everything.

Any help is really welcome.

p



> On 21 Mar 2024, at 09:03, Pierre Alexandre Tremblay <tremblap at gmail.com> wrote:
> 
> Ok one wisdom and one further question:
> 
> 1: one has to delete objects before ‘recreating’ them - I was making a lot, a lot of circles.
> 
> 2: is there a good practice example of writing for gui somewhere. I think I got a hunch of needed to delete from IEM’s toggle (which has a new and update method) and that opens a can of worm of a full re-write on my side… is there any tutorial out there on writing GUI ? Or commented code? Or good practice?
> 
> Anyway, I hope this will help someone. I searched ...
> 
> 
>> On 20 Mar 2024, at 20:00, Pierre Alexandre Tremblay <tremblap at gmail.com> wrote:
>> 
>> Hello
>> 
>> So I am trying to optimise the drawing of fluid.plotter… I have a dictionary in TCL land, which I thought would be clever, but it seems to get worse as I replace points.
>> 
>> 2 questions for the pros of the pd GUI coding:
>> 
>> 1. Is it better to keep my database in C and pass it afresh at all draw call and forget about dictionaries on the tcl side?
>> 
>> 2. If not, am I right to have noticed some struggle with dict on the tcl side?
>> 
>> The code in question is here:
>> 
>> https://github.com/flucoma/flucoma-pd/blob/main/src/fluid.plotter/fluid.plotter.c
>> 
>> 
>> The method is ‘addpoint’ - and if I enter the same points over and over again (like in the fluid.stat helpfile) it gets worse and worse and worse… and it is worse on Windows, then Mac, then less worse on Linux.
>> 
>> Any help welcome. I know the code is not ideal but I’m fighting on all fronts to try to keep a reactive GUI to plot and click many objects…
>> 
>> Thanks!
> 






More information about the Pd-list mailing list