[PD] [PD-dev] tkwidgets

Jonathan Wilkes jancsika at yahoo.com
Sat Aug 27 04:55:09 CEST 2011

----- Original Message -----
> From: Jonathan Wilkes <jancsika at yahoo.com>
> To: Patrice Colet <colet.patrice at free.fr>; pd-list <pd-list at iem.at>
> Cc: András Murányi <muranyia at gmail.com>; João Pais <jmmmpais at googlemail.com>
> Sent: Friday, August 26, 2011 10:46 PM
> Subject: Re: [PD] [PD-dev] tkwidgets
>> ________________________________
>> From: Patrice Colet <colet.patrice at free.fr>
>> To: pd-list <pd-list at iem.at>
>> Cc: András Murányi <muranyia at gmail.com>; Jonathan Wilkes 
> <jancsika at yahoo.com>; João Pais <jmmmpais at googlemail.com>
>> Sent: Friday, August 26, 2011 9:46 PM
>> Subject: Re: [PD] [PD-dev] tkwidgets
>> ----- "João Pais" <jmmmpais at googlemail.com> a écrit :
>>>  tcl/tk behaves very slowly for fast calls, such as when dragging an
>>>  array  
>>>  of considerable size, or a big group of objects? afaik this is
>>>  something  
>>>  that could be improved in the present platform, but how better could
>>>  it be  
>>>  when using another gui framework?
>> This is very slow because everything selected is moving, this method makes a 
> very slow dragging,
> Create "Put" menu array, size 1000.  Right-click 
> "properties" and in the "Canvas Properties" dialog, set the 
> x size to 1000.  Now you got an array consisting of 1000 separate rectangle 
> items-- to confirm this type the following into the 
> tcl prompt (show the prompt using the last item in the "Help" menu):
> foreach win [winfo children .] {foreach cwin [winfo children $win] {if {[winfo 
> class $cwin] eq "Canvas"} {foreach item [$cwin find withtag all] 
> {pdtk_post "[$cwin type $item]\n"}}}}
> A _little_ sluggish, could be improved (actually it's slightly improved if 
> you draw the points as polygons), but:
> Now change the array size in the "Array Properties" dialog to 
> 10000000.  In the "Canvas Properties" dialog, change the x size to 
> 10.  Type the same code as above in the tcl prompt and notice now (if you're 
> drawing the array elements as "points") you've only got 10 
> rectangles being drawn on the canvas.
> The first example is a little annoying, but can be improved by changing the 
> coords (possibly using a single tag for the entire array) rather than deleting 
> and redrawing the array.  The second example can't be blamed on tcl/tk and 
> at large array sizes is _much_ more likely to cause audio dropouts*.
> -Jonathan
> * because you're never going to need to draw an array with more rectangles 
> than what you have for screen width, which is at most a couple thousand, and 
> even with an array that big it's not maxing out the cpu on my dual-core 
> laptop.

Btw-- even for the size 1000 array above, part of the cpu usage and sluggishness is 
caused by whatever computations pd is doing before sending the message to the 
gui to create the next rectangle (see my message earlier in this thread).  So my 
example isn't exactly comparing tcl/tk speed to pd computation speed-- it's more like 
comparing a slightly bad apple to a much worse apple.  In both cases I think the 
significant "sluggishness" digits are due to whatever pd is doing between message 


More information about the Pd-list mailing list