Changeset 783
- Timestamp:
- Dec 4, 2009 5:11:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsascmds.tcl
- Property rcs:date changed from 2004/01/30 00:50:00 to 2004/04/27 14:12:04
- Property rcs:lines changed from +42 -1 to +44 -24
- Property rcs:rev changed from 1.55 to 1.56
r775 r783 133 133 wm iconname $w Dialog 134 134 wm protocol $w WM_DELETE_WINDOW { } 135 wm transient $w $data(-parent) 136 if {![string compare $tcl_platform(platform) "macintosh"]} { 137 unsupported1 style $w dBoxProc 135 # Make the message box transient if the parent is viewable. 136 if {[winfo viewable [winfo toplevel $data(-parent)]] } { 137 wm transient $w $data(-parent) 138 } 139 140 catch { 141 if {[string equal [tk windowingsystem] "classic"] 142 || [string equal [tk windowingsystem] "aqua"]} { 143 unsupported::MacWindowStyle style $w dBoxProc 144 } 138 145 } 139 146 … … 343 350 proc putontop {w "center 0"} { 344 351 # center window $w above its parent and make it stay on top 345 set wp [winfo parent $w] 346 wm transient $w [winfo toplevel $wp] 352 set wpt [winfo toplevel [set wp [winfo parent $w]]] 353 if {[winfo viewable $wpt]} { 354 wm transient $w $wpt 355 } 347 356 wm withdraw $w 348 357 update idletasks 349 358 if {$center} { 350 359 set x [expr {[winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ 351 - [winfo vrootx [winfo parent $w]]}]360 - [winfo vrootx $wpt]}] 352 361 set y [expr {[winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ 353 - [winfo vrooty [winfo parent $w]]}]362 - [winfo vrooty $wpt]}] 354 363 } else { 355 364 # center the new window in the middle of the parent 356 set x [expr [winfo x $wp ] + [winfo width $wp]/2 - \357 [winfo reqwidth $w]/2 - [winfo vrootx $wp ]]365 set x [expr [winfo x $wpt] + [winfo width $wpt]/2 - \ 366 [winfo reqwidth $w]/2 - [winfo vrootx $wpt]] 358 367 if {$x < 0} {set x 0} 359 368 set xborder 10 … … 362 371 ($x+[winfo reqwidth $w] + $xborder)] 363 372 } 364 set y [expr [winfo y $wp ] + [winfo height $wp]/2 - \365 [winfo reqheight $w]/2 - [winfo vrooty $wp ]]373 set y [expr [winfo y $wpt] + [winfo height $wpt]/2 - \ 374 [winfo reqheight $w]/2 - [winfo vrooty $wpt]] 366 375 if {$y < 0} {set y 0} 367 376 set yborder 25 … … 375 384 376 385 global makenew 377 set makenew(OldGrab) "" 378 set makenew(OldFocus) "" 379 catch {set makenew(OldFocus) [focus]} 380 catch {set makenew(OldGrab) [grab current $w]} 381 catch {grab $w} 382 } 383 386 # set grab & focus; use new approach for 8.3 & later 387 if {[info proc ::tk::SetFocusGrab] == ""} { 388 set makenew(OldGrab) "" 389 set makenew(OldFocus) "" 390 catch {set makenew(OldFocus) [focus]} 391 catch {set makenew(OldGrab) [grab current $w]} 392 catch {grab $w} 393 } else { 394 set makenew(OldGrab) $w 395 set makenew(OldFocus) $w 396 ::tk::SetFocusGrab $w $w 397 } 398 } 399 400 # restore focus after putontop has completed 384 401 proc afterputontop {} { 385 # restore focus386 402 global makenew 387 # reset focus & grab 388 catch{403 # reset focus & grab; use new approach for 8.3 & later 404 if {[info proc ::tk::SetFocusGrab] == ""} { 389 405 if {$makenew(OldFocus) != ""} { 390 focus $makenew(OldFocus) 391 } 392 } 393 catch { 406 catch {focus $makenew(OldFocus)} 407 } 394 408 if {$makenew(OldGrab) != ""} { 395 grab $makenew(OldGrab) 396 } 409 catch {grab $makenew(OldGrab)} 410 } 411 } else { 412 catch {::tk::RestoreFocusGrab $makenew(OldGrab) $makenew(OldFocus)} 397 413 } 398 414 } … … 852 868 incr colstr 5 853 869 } 870 } 871 if {$::tcl_platform(os) == "Darwin"} { 872 # on OS X force a window resize 873 wm geometry [winfo toplevel $w] {} 854 874 } 855 875 }
Note: See TracChangeset
for help on using the changeset viewer.