[PD] [PD-dev] tkwidgets
Hans-Christoph Steiner
hans at at.or.at
Sat Sep 3 21:24:03 CEST 2011
On Sep 3, 2011, at 2:37 PM, Mathieu Bouchard wrote:
> On Sun, 28 Aug 2011, Hans-Christoph Steiner wrote:
>
>> Receiving, parsing, and executing 1 megabyte of code per second is
>> actually pretty good, IMHO. What needs to happen is that Pd should
>> call Tcl procs not send blocks of raw Tcl.
>
> How do you do that ?
>
> DD has sys_mgui(), which operates at a level similar to
> binbuf_addv(), but constructs Tcl function calls. It still called
> sys_vgui() under the hood. However, if sys_vgui() had been
> completely replaced by sys_mgui(), then it would have become easy to
> replace that Tcl eval-based protocol by, for example, OSC-over-TCP.
>
> But what do _you_ have in mind, specifically ?
Here's a good example of what I mean: the drawing commands for
obj,msg, etc boxes should not be in 'pd'. 'pd' should tell 'pd-gui':
"draw an object on this canvas, at this x,y with these inlets and
outlets". "pd-gui" should also handle the mouse clicks, selection
coloration, change of line style from dashed to solid, etc. So
something like:
draw_object .x230ad0.c "osc~ 500" 10 500 inlet~ inlet outlet~
That would replace this block of raw Tcl:
.x230af0.c itemconfigure .x230af0.t230e90 -fill black
.x230af0.c itemconfigure .x230af0.t230e90R -fill black
.x230af0.c create rectangle 277 182 277 182 -tags x
.x230af0.c delete x
pdtk_undomenu .x230af0 paste no
pdtk_canvas_editmode .x230af0 1
.x230af0.c create line 146 134 174 134 174 151 146 151 146 134 -dash
"" -tags [list .x230af0.t230ba0R obj]
.x230af0.c create rectangle 146 150 153 151 -tags
[list .x230af0.t230ba0o0 outlet]
.x230af0.c create rectangle 146 134 153 136 -tags
[list .x230af0.t230ba0i0 inlet]
.x230af0.c create rectangle 167 134 174 136 -tags
[list .x230af0.t230ba0i1 inlet]
pdtk_text_new .x230af0.c {.x230af0.t230ba0 obj text} 148.000000
136.000000 {osc~ 500} 10 black
.x230af0.c itemconfigure .x230af0.t230ba0 -fill blue
.x230af0.c itemconfigure .x230af0.t230ba0R -fill blue
pdtk_canvas_getscroll .x230af0.c
.hc
----------------------------------------------------------------------------
"[W]e have invented the technology to eliminate scarcity, but we are
deliberately throwing it away to benefit those who profit from
scarcity." -John Gilmore
More information about the Pd-list
mailing list