Q: Left justify text in label widget ? 
Author Message
 Q: Left justify text in label widget ?

I am using a label widget to display status information. I would
like the text (one line) to be left justified, as opposed to
centered, within the widget.

The man pages indicate that the -justify option only comes into
play when there are multiple lines .... any ideas ?

TIA,

Nigel -



Sun, 12 Sep 1999 03:00:00 GMT  
 Q: Left justify text in label widget ?

Quote:

> I am using a label widget to display status information. I would
> like the text (one line) to be left justified, as opposed to
> centered, within the widget.

> The man pages indicate that the -justify option only comes into
> play when there are multiple lines .... any ideas ?

> TIA,

> Nigel -

Anchor might be what you are looking for.
try "-anchor w"

--
_________________________________________________________________
|      "Cheer up, It could be much worse." So, he did cheer
|      up, and it did become much worse...   [ Kaveret ]
|



Mon, 13 Sep 1999 03:00:00 GMT  
 Q: Left justify text in label widget ?

Quote:

> I am using a label widget to display status information. I would
> like the text (one line) to be left justified, as opposed to
> centered, within the widget.

> The man pages indicate that the -justify option only comes into
> play when there are multiple lines .... any ideas ?

> TIA,

> Nigel -

We had someone ask this same question just last week, so you may want
to look through the older articles. There are two questions that you
could be asking here - a) How do I get my text left justified within
the label widget, or b) How do I get my label widget to be 'left
justified' within the main window.  Justification only affects text,
not the position of the slave widgets within their parents.

If your question is actually a), the following will help you:

   Instead of having a -text option in your label widget, use the
 -textvariable option. If you use -textvariable, you can use
 the -justify option to justify the text. ie, the person who asked
 the question was listing decimal numbers, and it would have made
 more sense for these to be lined up on the right margin of his
 widget.

If your question is actually b), the following may help:

    When you pack the widget, you will want to use the -anchor option
 and -anchor it to w (for west). This will line the label up on the
 western edge of the widget. However, a drawback of this is that if the
 widgets that the label widget is in aren't anchored to the left, then
 your label widgets will be centered (as -anchor center is default for
 the pack command). I am not sure why it does this, and I have not
 heard a reason why yet. It just appears that the packing anchor
 specs on the higher level widgets determine and override the packing  
 anchor specs on the widgets within that widget.

Hope this helps!
--
 Tammie N. Philpott    


 URL http://web.egr.msu.edu/~philpott/



Tue, 14 Sep 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q: How to left-justify label text

2. Left Justify - Label

3. How do I justify text in a listbox (ie left, center or right)

4. Problem with -justify in label widget

5. Can Text widget autosize like Label widget?

6. Tab Widget with left/right side labels

7. Help: Right-justified lines in a text widget?

8. Some questions on elided text in the text widget (and a few other text widget questions)

9. Page Up/Down event masks and pos of top left corner of text widget

10. Label widget -text change font??

11. Aligning labels in a text widget

12. Shading foreground text of a label widget

 

 
Powered by phpBB® Forum Software