Tkinter Label 'justify' Problem

Discussion in 'Python' started by Dude, Sep 17, 2008.

  1. Dude

    Dude Guest

    Hi All,
    I am fairly new to Python programming. I am working on a small
    Tkinter project and I think I am missing something, maybe you can
    help. The two lines below is all I have related to the Label widget:

    lblServer = Tkinter.Label(serverFrame, text='Server:', fg='black',
    justify='left', relief='groove')

    lblServer.place_configure(width=200, bordermode='inside')


    No matter what I change the 'justify' to whether it's 'lef', 'right',
    or 'center', it always seems to be in the center.

    I am also writing the keys from the Label widget to a file because
    this has me so baffled. That is below.

    Thank in advance for any help or direction you can give me.

    Steve P

    ---------- lblServer keys -----------------
    activebackground : SystemButtonFace
    activeforeground : SystemButtonText
    anchor : center
    background : SystemButtonFace
    bd : 2
    bg : SystemButtonFace
    bitmap :
    borderwidth : 2
    compound : none
    cursor :
    disabledforeground : SystemDisabledText
    fg : black
    font : {MS Sans Serif} 8
    foreground : black
    height : 0
    highlightbackground : SystemButtonFace
    highlightcolor : SystemWindowFrame
    highlightthickness : 0
    image :
    justify : left
    padx : 1
    pady : 1
    relief : groove
    state : normal
    takefocus : 0
    text : NNTP Server:
    textvariable :
    underline : -1
    width : 0
    wraplength : 0
    ---------- lblServer keys END -------------
     
    Dude, Sep 17, 2008
    #1
    1. Advertising

  2. On Wed, Sep 17, 2008 at 2:18 PM, Dude <> wrote:
    > Hi All,
    > I am fairly new to Python programming. I am working on a small
    > Tkinter project and I think I am missing something, maybe you can
    > help. The two lines below is all I have related to the Label widget:
    >
    > lblServer = Tkinter.Label(serverFrame, text='Server:', fg='black',
    > justify='left', relief='groove')
    >
    > lblServer.place_configure(width=200, bordermode='inside')
    >
    >
    > No matter what I change the 'justify' to whether it's 'lef', 'right',
    > or 'center', it always seems to be in the center.


    The "justify" option comes into play only when you have a multi-line
    label, which is not the case. If you want it left/right aligned then
    use pack (instead of place, not really recommended but I don't know
    what you are doing) and specify the anchor option with an appropriate
    value ('e' or 'w') for what you want.

    >
    > I am also writing the keys from the Label widget to a file because
    > this has me so baffled. That is below.
    >
    > Thank in advance for any help or direction you can give me.
    >
    > Steve P
    >
    > ---------- lblServer keys -----------------
    > activebackground : SystemButtonFace
    > activeforeground : SystemButtonText
    > anchor : center
    > background : SystemButtonFace
    > bd : 2
    > bg : SystemButtonFace
    > bitmap :
    > borderwidth : 2
    > compound : none
    > cursor :
    > disabledforeground : SystemDisabledText
    > fg : black
    > font : {MS Sans Serif} 8
    > foreground : black
    > height : 0
    > highlightbackground : SystemButtonFace
    > highlightcolor : SystemWindowFrame
    > highlightthickness : 0
    > image :
    > justify : left
    > padx : 1
    > pady : 1
    > relief : groove
    > state : normal
    > takefocus : 0
    > text : NNTP Server:
    > textvariable :
    > underline : -1
    > width : 0
    > wraplength : 0
    > ---------- lblServer keys END -------------
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >




    --
    -- Guilherme H. Polo Goncalves
     
    Guilherme Polo, Sep 17, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?bWFudQ==?=

    Regd---Justify option in Alignment.

    =?Utf-8?B?bWFudQ==?=, Sep 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    461
    =?Utf-8?B?bWFudQ==?=
    Sep 23, 2005
  2. Mariame

    Justify Label Content

    Mariame, Sep 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,005
    Brian Lowe
    Sep 6, 2004
  3. Tina

    Right Justify Hyperlink Buttons?

    Tina, Dec 8, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    613
    G Dean Blake
    Dec 9, 2004
  4. Phil Barber

    Webcontrols.Label to Right Justify

    Phil Barber, Aug 4, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    112
    Dawn Baker
    Aug 4, 2003
  5. Knut Krueger
    Replies:
    8
    Views:
    307
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page