message box text 
Author Message
 message box text

Is there any way to centre multi-line text in  a tk_messageBox other than by
judicious padding with spaces?

Ian



Sun, 14 Oct 2007 06:53:01 GMT  
 message box text

Quote:

> Is there any way to centre multi-line text in a tk_messageBox other than
> by judicious padding with spaces?

Doesn't seem to be, tk_messageBox is a blocking procedure, so one has to
forget about
    .__tk__messagebox.msg -justify center
afterwards.
But all is not lost, yet. We can use option database for this. Messagebox
is of class Dialog, so
    option add *Dialog.msg.justify center
should do the trick. Alas, it doesn't, msgbox.tcl hardwires justify. So it
is up to you to grab lib/tk8.?/msgbox.tcl and do the magic. Here is diff
for 8.5a2 msgbox.tcl:

293c293,294
<     label $w.msg -anchor nw -justify left -text $data(-message) \
---

Quote:
>     option add *Dialog.msg.justify left widgetDefault
>     label $w.msg -anchor nw -text $data(-message) \

Now Dialog.msg respects justify, and you can adjust justifying.

Bad things probably happen with this, as I guess *Dialog.msg isn't just
tk_messageBox... But hey, I've never used option database so far, so this
is just a sketch for someone else to fill up :)

--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done



Sun, 14 Oct 2007 21:44:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. output color message (text) to a message box (string)

2. output color message (text) to a message box (string)

3. how to make the text differently colour displayed in a message box

4. Is There Message Box With Scrolling Text?

5. How to colorize, change font of text in text box

6. Accessing text in other applications windows text boxes

7. OODIALOG: TEXT MISSING IN A TEXT BOX

8. text file and text box script

9. How to save new text in text box

10. Message Boxes

11. CapeSoft - Message Box

12. New Line in Message Box

 

 
Powered by phpBB® Forum Software