[Paul Obermeier] 2002/09/16 Tk based program inspired by SGI's buttonfly. ---- #!/bin/sh # The next line restarts using wish \ exec wish "$0" -- ${1+"$@"} # tkButtonFly: A Tk-based replacement of SGI's buttonfly program. # Notice: Currently not supported: # ".popup." and ".menu. -". # Toggling between window and fullscreen mode. # No 3D buttons - and therfore no "fly". set auto_path [linsert $auto_path 0 [file dirname [info script]]] set auto_path [linsert $auto_path 0 [file dirname [info nameofexecutable]]] # Some functions to implement a simple toolhelp. proc poToolhelp:Init { w { bgColor yellow } { fgColor black } } { if { [winfo exists $w] } { destroy $w } toplevel $w set ::topWidget $w label $w.l -text "This is toolhelp" -bg $bgColor -fg $fgColor -relief ridge pack $w.l wm overrideredirect $w true wm geometry $w [format "+%d+%d" -100 -100] } proc poToolhelp:ShowToolhelp { x y str } { $::topWidget.l configure -text $str raise $::topWidget wm geometry $::topWidget [format "+%d+%d" $x [expr $y +10]] } proc poToolhelp:HideToolhelp {} { wm geometry $::topWidget [format "+%d+%d" -100 -100] } proc poToolhelp:AddBinding { w str } { if { ![info exists ::topWidget]} { poToolhelp:Init .poToolhelp } bind $w "poToolhelp:ShowToolhelp %X %Y [list $str]" bind $w { poToolhelp:HideToolhelp } bind $w