Revision: 10676 http://pure-data.svn.sourceforge.net/pure-data/?rev=10676&view=rev Author: lluisbigorda Date: 2009-01-29 06:41:17 +0000 (Thu, 29 Jan 2009)
Log Message: ----------- bug solved on tcl proc declarations
Modified Paths: -------------- trunk/externals/pdvjtools/colorgrid/colorgrid.c
Modified: trunk/externals/pdvjtools/colorgrid/colorgrid.c =================================================================== --- trunk/externals/pdvjtools/colorgrid/colorgrid.c 2009-01-29 03:48:16 UTC (rev 10675) +++ trunk/externals/pdvjtools/colorgrid/colorgrid.c 2009-01-29 06:41:17 UTC (rev 10676) @@ -55,75 +55,6 @@ t_symbol* x_fname; } t_colorgrid;
-void load_tk_procs () { - // ########### colorgrid procedures -- ydegoyon@free.fr ######### - // package require Img - sys_gui("package require base64\n"); - sys_gui("proc colorgrid_apply {id} {\n"); - // strip "." from the TK id to make a variable name suffix - sys_gui("set vid [string trimleft $id .]\n"); - // for each variable, make a local variable to hold its name... - sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n"); - sys_gui("global $var_graph_colorgrid\n"); - sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n"); - sys_gui("global $var_graph_xlines\n"); - sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n"); - sys_gui("global $var_graph_ylines\n"); - sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_xlines] [eval concat $$var_graph_ylines] [eval concat $$var_graph_colorgrid] \;]\n"); - // puts stderr $cmd - sys_gui("pd $cmd\n"); - sys_gui("}\n"); - sys_gui("proc colorgrid_cancel {id} {\n"); - sys_gui("set cmd [concat $id cancel \;]\n"); - // puts stderr $cmd - sys_gui("pd $cmd\n"); - sys_gui("}\n"); - sys_gui("proc colorgrid_ok {id} {\n"); - sys_gui("colorgrid_apply $id\n"); - sys_gui("colorgrid_cancel $id\n"); - sys_gui("}\n"); - sys_gui("proc pdtk_colorgrid_dialog {id xlines ylines colorgrid} {\n"); - sys_gui("set vid [string trimleft $id .]\n"); - sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n"); - sys_gui("global $var_graph_colorgrid\n"); - sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n"); - sys_gui("global $var_graph_xlines\n"); - sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n"); - sys_gui("global $var_graph_ylines\n"); - sys_gui("set $var_graph_colorgrid $colorgrid\n"); - sys_gui("set $var_graph_xlines $xlines\n"); - sys_gui("set $var_graph_ylines $ylines\n"); - sys_gui("toplevel $id\n"); - sys_gui("wm title $id {colorgrid}\n"); - sys_gui("wm protocol $id WM_DELETE_WINDOW [concat colorgrid_cancel $id]\n"); - sys_gui("label $id.label -text {COLORGRID PROPERTIES}\n"); - sys_gui("pack $id.label -side top\n"); - sys_gui("frame $id.buttonframe\n"); - sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n"); - sys_gui("button $id.buttonframe.cancel -text {Cancel} -command "colorgrid_cancel $id"\n"); - sys_gui("button $id.buttonframe.apply -text {Apply} -command "colorgrid_apply $id"\n"); - sys_gui("button $id.buttonframe.ok -text {OK} -command "colorgrid_ok $id"\n"); - sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n"); - sys_gui("pack $id.buttonframe.apply -side left -expand 1\n"); - sys_gui("pack $id.buttonframe.ok -side left -expand 1\n"); - sys_gui("frame $id.42rangef\n"); - sys_gui("pack $id.42rangef -side top\n"); - sys_gui("label $id.42rangef.lxlines -text "X sections :"\n"); - sys_gui("entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7\n"); - sys_gui("pack $id.42rangef.lxlines $id.42rangef.xlines -side left\n"); - sys_gui("frame $id.72rangef\n"); - sys_gui("pack $id.72rangef -side top\n"); - sys_gui("label $id.72rangef.lylines -text "Y sections :"\n"); - sys_gui("entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7\n"); - sys_gui("pack $id.72rangef.lylines $id.72rangef.ylines -side left\n"); - sys_gui("checkbutton $id.showcolorgrid -text {Show Grid} -variable $var_graph_colorgrid -anchor w\n"); - sys_gui("pack $id.showcolorgrid -side top\n"); - sys_gui("bind $id.42rangef.xlines <KeyPress-Return> [concat colorgrid_ok $id]\n"); - sys_gui("bind $id.72rangef.ylines <KeyPress-Return> [concat colorgrid_ok $id]\n"); - sys_gui("focus $id.42rangef.xlines\n"); - sys_gui("}\n"); - // ########### colorgrid procedures END -- lluis@artefacte.org ######### -}
t_widgetbehavior colorgrid_widgetbehavior; static t_class *colorgrid_class; @@ -1633,7 +1564,74 @@
void colorgrid_setup(void) { - load_tk_procs(); + // ########### colorgrid procedures -- ydegoyon@free.fr ######### + // package require Img + sys_gui("package require base64\n"); + sys_gui("proc colorgrid_apply {id} {\n"); + // strip "." from the TK id to make a variable name suffix + sys_gui("set vid [string trimleft $id .]\n"); + // for each variable, make a local variable to hold its name... + sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n"); + sys_gui("global $var_graph_colorgrid\n"); + sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n"); + sys_gui("global $var_graph_xlines\n"); + sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n"); + sys_gui("global $var_graph_ylines\n"); + sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_xlines] [eval concat $$var_graph_ylines] [eval concat $$var_graph_colorgrid] \;]\n"); + // puts stderr $cmd + sys_gui("pd $cmd\n"); + sys_gui("}\n"); + sys_gui("proc colorgrid_cancel {id} {\n"); + sys_gui("set cmd [concat $id cancel \;]\n"); + // puts stderr $cmd + sys_gui("pd $cmd\n"); + sys_gui("}\n"); + sys_gui("proc colorgrid_ok {id} {\n"); + sys_gui("colorgrid_apply $id\n"); + sys_gui("colorgrid_cancel $id\n"); + sys_gui("}\n"); + sys_gui("proc pdtk_colorgrid_dialog {id xlines ylines colorgrid} {\n"); + sys_gui("set vid [string trimleft $id .]\n"); + sys_gui("set var_graph_colorgrid [concat graph_colorgrid_$vid]\n"); + sys_gui("global $var_graph_colorgrid\n"); + sys_gui("set var_graph_xlines [concat graph_xlines_$vid]\n"); + sys_gui("global $var_graph_xlines\n"); + sys_gui("set var_graph_ylines [concat graph_ylines_$vid]\n"); + sys_gui("global $var_graph_ylines\n"); + sys_gui("set $var_graph_colorgrid $colorgrid\n"); + sys_gui("set $var_graph_xlines $xlines\n"); + sys_gui("set $var_graph_ylines $ylines\n"); + sys_gui("toplevel $id\n"); + sys_gui("wm title $id {colorgrid}\n"); + sys_gui("wm protocol $id WM_DELETE_WINDOW [concat colorgrid_cancel $id]\n"); + sys_gui("label $id.label -text {COLORGRID PROPERTIES}\n"); + sys_gui("pack $id.label -side top\n"); + sys_gui("frame $id.buttonframe\n"); + sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n"); + sys_gui("button $id.buttonframe.cancel -text {Cancel} -command "colorgrid_cancel $id"\n"); + sys_gui("button $id.buttonframe.apply -text {Apply} -command "colorgrid_apply $id"\n"); + sys_gui("button $id.buttonframe.ok -text {OK} -command "colorgrid_ok $id"\n"); + sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n"); + sys_gui("pack $id.buttonframe.apply -side left -expand 1\n"); + sys_gui("pack $id.buttonframe.ok -side left -expand 1\n"); + sys_gui("frame $id.42rangef\n"); + sys_gui("pack $id.42rangef -side top\n"); + sys_gui("label $id.42rangef.lxlines -text "X sections :"\n"); + sys_gui("entry $id.42rangef.xlines -textvariable $var_graph_xlines -width 7\n"); + sys_gui("pack $id.42rangef.lxlines $id.42rangef.xlines -side left\n"); + sys_gui("frame $id.72rangef\n"); + sys_gui("pack $id.72rangef -side top\n"); + sys_gui("label $id.72rangef.lylines -text "Y sections :"\n"); + sys_gui("entry $id.72rangef.ylines -textvariable $var_graph_ylines -width 7\n"); + sys_gui("pack $id.72rangef.lylines $id.72rangef.ylines -side left\n"); + sys_gui("checkbutton $id.showcolorgrid -text {Show Grid} -variable $var_graph_colorgrid -anchor w\n"); + sys_gui("pack $id.showcolorgrid -side top\n"); + sys_gui("bind $id.42rangef.xlines <KeyPress-Return> [concat colorgrid_ok $id]\n"); + sys_gui("bind $id.72rangef.ylines <KeyPress-Return> [concat colorgrid_ok $id]\n"); + sys_gui("focus $id.42rangef.xlines\n"); + sys_gui("}\n"); + // ########### colorgrid procedures END -- lluis@artefacte.org ######### + post ( colorgrid_version ); colorgrid_class = class_new(gensym("colorgrid"), (t_newmethod)colorgrid_new, (t_method)colorgrid_free, sizeof(t_colorgrid), 0, A_GIMME, 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.