Changeset 13 for trunk/gui/scripts/mainwin.tcl
- Timestamp:
- Jun 8, 2005, 5:37:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mainwin.tcl
r11 r13 138 138 } 139 139 140 set titleh 0141 set fnt [option get $itk_component(hull) titleFont Font]142 if {$itk_option(-title) != "" && $fnt != ""} {143 set titleh [expr {[font metrics $fnt -linespace]+2}]144 }145 if {$h+$titleh > $sh} {146 set $h [expr {$sh-$titleh}]147 set clip 1148 }149 150 140 switch -- $itk_option(-anchor) { 151 141 n { 152 142 set x [expr {$sw/2}] 153 set y $titleh 154 set tx [expr {$x-$w/2}] 155 set ty $titleh 143 set y 0 156 144 } 157 145 s { 158 146 set x [expr {$sw/2}] 159 147 set y $sh 160 set tx [expr {$x-$w/2}]161 set ty [expr {$sh-$h}]162 148 } 163 149 center { 164 150 set x [expr {$sw/2}] 165 151 set y [expr {$sh/2}] 166 set tx [expr {$x-$w/2}]167 set ty [expr {$y-$h/2}]168 152 } 169 153 w { 170 154 set x 0 171 155 set y [expr {$sh/2}] 172 set tx 0173 set ty [expr {$y-$h/2}]174 156 } 175 157 e { 176 158 set x $sw 177 159 set y [expr {$sh/2}] 178 set tx [expr {$sw-$w}]179 set ty [expr {$y-$h/2}]180 160 } 181 161 nw { 182 162 set x 0 183 set y $titleh 184 set tx 0 185 set ty $titleh 163 set y 0 186 164 } 187 165 ne { 188 166 set x $sw 189 set y $titleh 190 set tx [expr {$sw-$w}] 191 set ty $titleh 167 set y 0 192 168 } 193 169 sw { 194 170 set x 0 195 171 set y $sh 196 set tx 0197 set ty [expr {$sh-$h}]198 172 } 199 173 se { 200 174 set x $sw 201 175 set y $sh 202 set tx [expr {$sw-$w}]203 set ty [expr {$sh-$h}]204 176 } 205 177 } … … 214 186 -anchor $itk_option(-anchor) -window $itk_component(app) \ 215 187 -width $w -height $h 216 217 if {$itk_option(-title) != "" && $fnt != ""} {218 $itk_component(area) create text $tx [expr {$ty-2}] \219 -anchor sw -text $itk_option(-title) -font $fnt220 }221 188 } 222 189 }
Note: See TracChangeset
for help on using the changeset viewer.