aboutsummaryrefslogtreecommitdiff
path: root/audience~/audience~.tk2c
blob: ea3a7a33d8cea20f135fb20dda3fbda7b45b539c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// ########### audience procedures -- ydegoyon@free.fr #########
sys_gui("proc audience_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_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_nboutputs [concat graph_nboutputs_$vid]\n");
sys_gui("global $var_graph_nboutputs\n");
sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_nboutputs] \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc audience_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 audience_ok {id} {\n");
sys_gui("audience_apply $id\n");
sys_gui("audience_cancel $id\n");
sys_gui("}\n");
sys_gui("proc pdtk_audience_dialog {id width height nboutputs} {\n");
sys_gui("set vid [string trimleft $id .]\n");
sys_gui("set var_graph_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_nboutputs [concat graph_nboutputs_$vid]\n");
sys_gui("global $var_graph_nboutputs\n");
sys_gui("set $var_graph_width $width\n");
sys_gui("set $var_graph_height $height\n");
sys_gui("set $var_graph_nboutputs $nboutputs\n");
sys_gui("toplevel $id\n");
sys_gui("wm title $id {audience}\n");
sys_gui("wm protocol $id WM_DELETE_WINDOW [concat audience_cancel $id]\n");
sys_gui("label $id.label -text {2$ SPACE 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 \"audience_cancel $id\"\n");
sys_gui("button $id.buttonframe.apply -text {Apply} -command \"audience_apply $id\"\n");
sys_gui("button $id.buttonframe.ok -text {OK} -command \"audience_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.1rangef\n");
sys_gui("pack $id.1rangef -side top\n");
sys_gui("label $id.1rangef.lwidth -text \"Width :\"\n");
sys_gui("entry $id.1rangef.width -textvariable $var_graph_width -width 7\n");
sys_gui("pack $id.1rangef.lwidth $id.1rangef.width -side left\n");
sys_gui("frame $id.2rangef\n");
sys_gui("pack $id.2rangef -side top\n");
sys_gui("label $id.2rangef.lheight -text \"Height :\"\n");
sys_gui("entry $id.2rangef.height -textvariable $var_graph_height -width 7\n");
sys_gui("pack $id.2rangef.lheight $id.2rangef.height -side left\n");
sys_gui("frame $id.3rangef\n");
sys_gui("pack $id.3rangef -side top\n");
sys_gui("label $id.3rangef.lnboutputs -text \"Nb Listeners :\"\n");
sys_gui("entry $id.3rangef.nboutputs -textvariable $var_graph_nboutputs -width 7\n");
sys_gui("pack $id.3rangef.lnboutputs $id.3rangef.nboutputs -side left\n");
sys_gui("bind $id.1rangef.width <KeyPress-Return> [concat audience_ok $id]\n");
sys_gui("bind $id.2rangef.height <KeyPress-Return> [concat audience_ok $id]\n");
sys_gui("bind $id.3rangef.nboutputs <KeyPress-Return> [concat audience_ok $id]\n");
sys_gui("focus $id.1rangef.width\n");
sys_gui("}\n");
// ########### audience procedures END -- ydegoyon@free.fr #########