Rather than doing this when applet.tcl is source, which was weird and
troublesome.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This also uses the same variables as setup-subwindow.
-wm withdraw .
-
-tktray::icon .i -class example
-.i configure -docked 1
+namespace eval applet {
-fconfigure stdout -buffering none
-fconfigure stderr -buffering none
+proc become {} {
+ wm withdraw .
+ tktray::icon .i -class example
+ .i configure -docked 1
-namespace eval applet {
+ fconfigure stdout -buffering none
+ fconfigure stderr -buffering none
+}
# used by both menus and tooltips
variable posted 0
source $lib/subproc.tcl
source $lib/utils.tcl
+applet::become
+
set debug::debug puts
foreach b {1 3} {
source $lib/subproc.tcl
source $lib/utils.tcl
source $lib/args.tcl
+source $lib/applet.tcl
proc cmdline {id orientation} {
global argv
#----- modes -----
proc mode/normal {} {
- uplevel #0 { source $lib/applet.tcl }
+ uplevel #0 { applet::become }
applet::setup-subproc cmdline
applet::setup-tooltip tt-show tt-invisible
}