Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tk_messageBox screen location

Status
Not open for further replies.

srhoads

Programmer
Nov 21, 2001
21
0
0
US
I am using Wish 8.0 and recently my NT has gotten into a mode so the tk_messageBox windows in all the programs I have written popup in the lower right corner of the screen and I would like them to popup in the middle of the screen. Any ideas?
 
This is probably not the most elegant way but I center windows like this:

set sw [lindex [wm maxsize <window name>] 0]
set sh [lindex [wm maxsize <window name>] 1]
set ww [winfo width <window name>]
set wh [winfo height <window name>]
set newx [expr ($sw-$ww)/2]
set newy [expr ($sh-$wh)/2]
wm geometry <window name> &quot;+$newx+$newy&quot; Bob Rashkin
rrashkin@csc.com
 
I rebooted the NT and everything is now ok. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top