chiark / gitweb /
wip subwindow
[chiark-tcl-applet.git] / example
diff --git a/example b/example
index 8c5e0c921bda0c32f673221aafa18f64aa1de37b..b1a9c862236e90c57b6bc0196f1c00d64d51ad83 100755 (executable)
--- a/example
+++ b/example
@@ -2,6 +2,7 @@
 # -*- Tcl -*-
 
 source applet.tcl
+source subproc.tcl
 
 #----- menu -----
 
@@ -9,8 +10,8 @@ foreach b {1 3} {
     applet::setup-button-menu $b
 }
 
-.m1 add command -command { msel; puts hi } -label hi
-.m3 add command -command { msel; puts boo } -label boo
+.m1 add command -command { applet::msel; puts hi } -label hi
+.m3 add command -command { applet::msel; puts boo } -label boo
 
 #image create bitmap ims -file gs_s.xbm   
 #image create bitmap ims -file /usr/share/ghostscript/8.71/lib/gs_s.xbm   
@@ -24,7 +25,7 @@ fconfigure stdout -buffering line
 
 set status none
 
-proc innerwindow-destroying {} {
+proc destroying {} {
     global status
     puts "DESTROYING $status"
     switch -exact $status {
@@ -34,7 +35,7 @@ proc innerwindow-destroying {} {
     }
 }
 
-proc innerwindow-ready {} {
+proc ready {} {
     global status
     puts "READY $status"
     switch -exact $status {
@@ -68,7 +69,7 @@ proc run-child {} {
     }
 
     set status none
-    set status [fork-then child-died {
+    set status [subproc::fork child-died {
        execl xacpi-simple [list -into [winfo id .i.i.b.c]]
     }]
     puts "FORKED $status"
@@ -89,4 +90,4 @@ proc child-died {how how2} {
     }
 }
 
-setupinnerwindow 40
+applet::setup-subwindow 40 destroying ready