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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Justification of text in MessageDlg

Status
Not open for further replies.

nater

Programmer
Jun 14, 2002
21
CA
OK, does the justify option not work in the BWidget MessageDlg?
Whether I do

MessageDlg .msgdlg -parent . -message "Why doesn't\nthis thing work?" -type ok -justify center -icon info

or even

MessageDlg .msgdlg -parent . -message "Why doesn't
this thing work?" -type ok -justify center -icon info

I get all the text justified left. -justify right doesn't seem to work either.
 
Well, I've identified why it doesn't work, but not why it was designed that way. By diving into the code, I discovered that in many cases, BWidget's MessageDlg simply massages its arguments and calls tk_messageBox, rather than building a dialog from scratch. I suppose that this takes advantage of the platform-native dialog styles provided by tk_messageBox. But the disadvantage to this approach is that several MessageDlg options, including -justify and -aspect, aren't supported by tk_messageBox and so they are ignored.

Don't shoot the messenger, I'm just reporting what I found... - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Ha.. well, that's stupid.. =)
"in many cases"? So sometimes these options will work?
 
Yes, sometimes they'll work. I've not gone through all of the logic of the code, but it appears that if you have a -type user dialog, the options work; any other type ends up using the tk_messageBox. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top