X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-tcl-applet.git;a=blobdiff_plain;f=applet.tcl;h=5c6ad29c44e1f55e7ef053f6a727094337325d0b;hp=0b0fcf6847807681008ca6a0bb7b50de73e4678e;hb=1c191f202bc6f8d0e800d055d9421976378fc1a7;hpb=2bd5a59bf618766427eff5e1bc4ebd00eb74ed6c diff --git a/applet.tcl b/applet.tcl index 0b0fcf6..5c6ad29 100644 --- a/applet.tcl +++ b/applet.tcl @@ -2,6 +2,8 @@ #----- general machinery ----- package require tktray +#load /home/ian/things/Systray/tktray-1.3.8/libtktray1.3.8.so + wm withdraw . @@ -37,6 +39,29 @@ proc msel {} { set posted 0 } +proc setupinnerwindow {} { + global innerwindow_after innerwindow + catch { after cancel $innerwindow_after } + catch { unset innerwindow_after } + if {[info exists innerwindow]} return + set children {} + foreach child [winfo children .i] { + if {![winfo exists $child]} continue + lappend children $child + } + if {[llength $children]==1} { + set innerwindow [lindex $children 0] + bind $innerwindow { + innerwindow-unavailable + catch { unset innerwindow } + after idle setupinnerwindow + } + innerwindow-available + } else { + after 5000 setupinnerwindow + } +} + bind .i { pressed %b %X %Y } proc tooltip_starttimer {state x y} {