Tkinter Label 'justify' Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dude

    Tkinter Label 'justify' Problem

    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(s erverFrame, text='Server:', fg='black',
    justify='left', relief='groove' )

    lblServer.place _configure(widt h=200, bordermode='ins ide')


    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 -----------------
    activebackgroun d : SystemButtonFac e
    activeforegroun d : SystemButtonTex t
    anchor : center
    background : SystemButtonFac e
    bd : 2
    bg : SystemButtonFac e
    bitmap :
    borderwidth : 2
    compound : none
    cursor :
    disabledforegro und : SystemDisabledT ext
    fg : black
    font : {MS Sans Serif} 8
    foreground : black
    height : 0
    highlightbackgr ound : SystemButtonFac e
    highlightcolor : SystemWindowFra me
    highlightthickn ess : 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 -------------
  • Guilherme Polo

    #2
    Re: Tkinter Label 'justify' Problem

    On Wed, Sep 17, 2008 at 2:18 PM, Dude <steve077@gmail .comwrote:
    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(s erverFrame, text='Server:', fg='black',
    justify='left', relief='groove' )
    >
    lblServer.place _configure(widt h=200, bordermode='ins ide')
    >
    >
    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 -----------------
    activebackgroun d : SystemButtonFac e
    activeforegroun d : SystemButtonTex t
    anchor : center
    background : SystemButtonFac e
    bd : 2
    bg : SystemButtonFac e
    bitmap :
    borderwidth : 2
    compound : none
    cursor :
    disabledforegro und : SystemDisabledT ext
    fg : black
    font : {MS Sans Serif} 8
    foreground : black
    height : 0
    highlightbackgr ound : SystemButtonFac e
    highlightcolor : SystemWindowFra me
    highlightthickn ess : 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 -------------
    --

    >


    --
    -- Guilherme H. Polo Goncalves

    Comment

    Working...