GIF89a; EcchiShell v1.0
//usr/lib64/lib64/lib64/tcl8.5/Tix8.4.3/

{ [tixGetMethod %W [set %W(className)] Destructor] %W } proc tixPrimitive:SetBindings {w} { upvar #0 $w data if {[winfo toplevel $w] eq $w} { bindtags $w [concat TixDestroyHandler [bindtags $w]] } else { bind $data(w:root) \ "[tixGetMethod $w $data(className) Destructor] $w" } } #---------------------------------------------------------------------- # PrivateMethod: ConstructWidget # # Construct and set up the compound widget # # Override: sometimes # Chain : sometimes, before # proc tixPrimitive:ConstructWidget {w} { upvar #0 $w data $data(rootCmd) config \ -background $data(-background) \ -borderwidth $data(-borderwidth) \ -cursor $data(-cursor) \ -relief $data(-relief) if {$data(-width) != 0} { $data(rootCmd) config -width $data(-width) } if {$data(-height) != 0} { $data(rootCmd) config -height $data(-height) } set rootname *[string range $w 1 end] foreach {spec value} $data(-options) { option add $rootname*$spec $value 100 } } #---------------------------------------------------------------------- # PrivateMethod: MkWidgetCmd # # Construct and set up the compound widget # # Override: sometimes # Chain : sometimes, before # proc tixPrimitive:MkWidgetCmd {w} { upvar #0 $w data rename $w $data(rootCmd) tixInt_MkInstanceCmd $w } #---------------------------------------------------------------------- # ConfigOptions: #---------------------------------------------------------------------- #---------------------------------------------------------------------- # ConfigMethod: config # # Configure one option. # # Override: always # Chain : automatic. # # Note the hack of [winfo width] in this procedure # # The hack is necessary because of the bad interaction between TK's geometry # manager (the packer) and the frame widget. The packer determines the size # of the root widget of the ComboBox (a frame widget) according to the # requirement of the slaves inside the frame widget, NOT the -width # option of the frame widget. # # However, everytime the frame widget is # configured, it sends a geometry request to the packer according to its # -width and -height options and the packer will temporarily resize # the frame widget according to the requested size! The packer then realizes # something is wrong and revert to the size determined by the slaves. This # cause a flash on the screen. # foreach opt {-height -width -background -borderwidth -cursor -highlightbackground -highlightcolor -relief -takefocus -bd -bg} { set tixPrimOpt($opt) 1 } proc tixPrimitive:config {w option value} { global tixPrimOpt upvar #0 $w data if {[info exists tixPrimOpt($option)]} { $data(rootCmd) config $option $value } } #---------------------------------------------------------------------- # PublicMethods: #---------------------------------------------------------------------- #---------------------------------------------------------------------- # This method is used to implement the "subwidgets" widget command. # Will be re-written in C. It can't be used as a public method because # of the lame substring comparison routines used in tixClass.c # # proc tixPrimitive:subwidgets {w type args} { upvar #0 $w data case $type { -class { set name [lindex $args 0] set args [lrange $args 1 end] # access subwidgets of a particular class # # note: if $name=="Frame", will *not return the root widget as well # set sub "" foreach des [tixDescendants $w] { if {[winfo class $des] eq $name} { lappend sub $des } } # Note: if the there is no subwidget of this class, does not # cause any error. # if {$args eq ""} { return $sub } else { foreach des $sub { eval [linsert $args 0 $des] } return "" } } -group { set name [lindex $args 0] set args [lrange $args 1 end] # access subwidgets of a particular group # if {[info exists data(g:$name)]} { if {$args eq ""} { set ret "" foreach item $data(g:$name) { lappend ret $w.$item } return $ret } else { foreach item $data(g:$name) { eval [linsert $args 0 $w.$item] } return "" } } else { error "no such subwidget group $name" } } -all { set sub [tixDescendants $w] if {$args eq ""} { return $sub } else { foreach des $sub { eval [linsert $args 0 $des] } return "" } } default { error "unknown flag $type, should be -all, -class or -group" } } } #---------------------------------------------------------------------- # PublicMethod: subwidget # # Access a subwidget withe a particular name # # Override: never # Chain : never # # This is implemented in native C code in tixClass.c # proc tixPrimitive:subwidget {w name args} { upvar #0 $w data if {[info exists data(w:$name)]} { if {$args eq ""} { return $data(w:$name) } else { return [eval [linsert $args 0 $data(w:$name)]] } } else { error "no such subwidget $name" } } #---------------------------------------------------------------------- # PrivateMethods: #---------------------------------------------------------------------- # delete the widget record and remove the command # proc tixPrimitive:Destructor {w} { upvar #0 $w data if {![info exists data(w:root)]} { return } if {[llength [info commands $w]]} { # remove the command rename $w "" } if {[llength [info commands $data(rootCmd)]]} { # remove the command of the root widget rename $data(rootCmd) "" } # delete the widget record catch {unset data} }