Changeset 26 for trunk/gui/scripts/groupentry.tcl
- Timestamp:
- Jul 19, 2005, 1:15:04 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/groupentry.tcl
r22 r26 12 12 package require Itk 13 13 14 option add *GroupEntry.headingBackground #cccccc widgetDefault 15 option add *GroupEntry.headingForeground white widgetDefault 16 option add *GroupEntry.font -*-helvetica-medium-r-normal-*-*-120-* widgetDefault 17 14 18 itcl::class Rappture::GroupEntry { 15 19 inherit itk::Widget 20 21 itk_option define -heading heading Heading 1 16 22 17 23 constructor {owner path args} { # defined below } … … 21 27 public method label {} 22 28 public method tooltip {} 29 30 protected method _fixheading {} 23 31 24 32 private variable _owner "" ;# thing managing this control … … 42 50 set _owner $owner 43 51 set _path $path 52 53 itk_component add heading { 54 ::label $itk_interior.heading -anchor w 55 } { 56 usual 57 rename -background -headingbackground headingBackground Background 58 rename -foreground -headingforeground headingForeground Foreground 59 } 60 61 $itk_component(heading) configure \ 62 -text [$_owner xml get $_path.about.label] 63 Rappture::Tooltip::for $itk_component(heading) \ 64 [$_owner xml get $_path.about.description] 65 66 itk_component add outline { 67 frame $itk_interior.outline -borderwidth 1 68 } { 69 usual 70 ignore -borderwidth 71 rename -background -headingbackground headingBackground Background 72 } 73 pack $itk_component(outline) -expand yes -fill both 74 75 itk_component add inner { 76 frame $itk_component(outline).inner -borderwidth 3 77 } { 78 usual 79 ignore -borderwidth 80 } 81 pack $itk_component(inner) -expand yes -fill both 44 82 45 83 eval itk_initialize $args … … 67 105 # ---------------------------------------------------------------------- 68 106 itcl::body Rappture::GroupEntry::label {} { 69 return [$_owner xml get $_path.about.label]107 return "" ;# manage the label inside this group 70 108 } 71 109 … … 81 119 return [$_owner xml get $_path.about.description] 82 120 } 121 122 # ---------------------------------------------------------------------- 123 # CONFIGURATION OPTION: -heading 124 # Turns the heading bar at the top of this group on/off. 125 # ---------------------------------------------------------------------- 126 itcl::configbody Rappture::GroupEntry::heading { 127 if {![string is boolean -strict $itk_option(-heading)]} { 128 error "bad value \"$itk_option(-heading)\": should be boolean" 129 } 130 131 set str [$itk_component(heading) cget -text] 132 if {$itk_option(-heading) && "" != $str} { 133 eval pack forget [pack slaves $itk_component(hull)] 134 pack $itk_component(heading) -side top -fill x 135 pack $itk_component(outline) -expand yes -fill both 136 $itk_component(outline) configure -borderwidth 1 137 $itk_component(inner) configure -borderwidth 3 138 } else { 139 pack forget $itk_component(heading) 140 $itk_component(outline) configure -borderwidth 0 141 $itk_component(inner) configure -borderwidth 0 142 } 143 }
Note: See TracChangeset
for help on using the changeset viewer.