diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-07-31 03:59:16 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@iem.at> | 2015-10-14 15:23:30 +0200 |
commit | d145fa6f792d6c44da2feec90507adb94e40323e (patch) | |
tree | ae3aaf213dbb4273331745802ef1259dce8e2986 /audience~.tcl | |
parent | 67af8f6b3f179d5b4ba0747ab971abbeecbedd45 (diff) |
got everything building using the template Makefile
svn path=/trunk/externals/unauthorized/; revision=15173
Diffstat (limited to 'audience~.tcl')
-rw-r--r-- | audience~.tcl | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/audience~.tcl b/audience~.tcl new file mode 100644 index 0000000..fcf7458 --- /dev/null +++ b/audience~.tcl @@ -0,0 +1,90 @@ +############ audience procedures -- ydegoyon@free.fr ######### + +proc audience_apply {id} { +# strip "." from the TK id to make a variable name suffix + set vid [string trimleft $id .] +# for each variable, make a local variable to hold its name... + set var_graph_width [concat graph_width_$vid] + global $var_graph_width + set var_graph_height [concat graph_height_$vid] + global $var_graph_height + set var_graph_nboutputs [concat graph_nboutputs_$vid] + global $var_graph_nboutputs + + set cmd [concat $id dialog \ + [eval concat $$var_graph_width] \ + [eval concat $$var_graph_height] \ + [eval concat $$var_graph_nboutputs] \ + \;] + #puts stderr $cmd + pd $cmd +} + +proc audience_cancel {id} { + set cmd [concat $id cancel \;] + #puts stderr $cmd + pd $cmd +} + +proc audience_ok {id} { + audience_apply $id + audience_cancel $id +} + +proc pdtk_audience_dialog {id width height nboutputs} { + set vid [string trimleft $id .] + set var_graph_width [concat graph_width_$vid] + global $var_graph_width + set var_graph_height [concat graph_height_$vid] + global $var_graph_height + set var_graph_nboutputs [concat graph_nboutputs_$vid] + global $var_graph_nboutputs + + set $var_graph_width $width + set $var_graph_height $height + set $var_graph_nboutputs $nboutputs + + toplevel $id + wm title $id {audience} + wm protocol $id WM_DELETE_WINDOW [concat audience_cancel $id] + + label $id.label -text {2$ SPACE PROPERTIES} + pack $id.label -side top + + frame $id.buttonframe + pack $id.buttonframe -side bottom -fill x -pady 2m + button $id.buttonframe.cancel -text {Cancel}\ + -command "audience_cancel $id" + button $id.buttonframe.apply -text {Apply}\ + -command "audience_apply $id" + button $id.buttonframe.ok -text {OK}\ + -command "audience_ok $id" + pack $id.buttonframe.cancel -side left -expand 1 + pack $id.buttonframe.apply -side left -expand 1 + pack $id.buttonframe.ok -side left -expand 1 + + frame $id.1rangef + pack $id.1rangef -side top + label $id.1rangef.lwidth -text "Width :" + entry $id.1rangef.width -textvariable $var_graph_width -width 7 + pack $id.1rangef.lwidth $id.1rangef.width -side left + + frame $id.2rangef + pack $id.2rangef -side top + label $id.2rangef.lheight -text "Height :" + entry $id.2rangef.height -textvariable $var_graph_height -width 7 + pack $id.2rangef.lheight $id.2rangef.height -side left + + frame $id.3rangef + pack $id.3rangef -side top + label $id.3rangef.lnboutputs -text "Nb Listeners :" + entry $id.3rangef.nboutputs -textvariable $var_graph_nboutputs -width 7 + pack $id.3rangef.lnboutputs $id.3rangef.nboutputs -side left + + bind $id.1rangef.width <KeyPress-Return> [concat audience_ok $id] + bind $id.2rangef.height <KeyPress-Return> [concat audience_ok $id] + bind $id.3rangef.nboutputs <KeyPress-Return> [concat audience_ok $id] + focus $id.1rangef.width +} + +############ audience procedures END -- ydegoyon@free.fr ######### |