Thread: Tkinter

    #1
  1. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407

    Tkinter


    if i was to code a Tkinter with just a frame,entry, button, how will change the width of the Tkinter to make the button fit on the same line as the entry?
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    All to do with the pack() method.. too pack your entry box on one side, and your button on the other, the two main options your looking for are fill ('x' oy 'y') and expand which you need to set to True for it too work! Something like..

    entry.pack(side = 'right', fill = 'x', expand = True)
    button.pack(side = 'right', fill = 'x', expand = True)

    None: thiis should also work with using grid() instead of pack()

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    nice.. so one more thing.. what if i wanted to add a spce in between them
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Very quick answer
    programming language development: www.netytan.com Hula

  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Very quick answer , you can tell Tkinter how much space to add around the widget using the padx option.. if you want more power you should probably use grid() isntead of pack()

    Mark.
    programming language development: www.netytan.com Hula

  10. #6
  11. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    got ya buddy.. thanx

IMN logo majestic logo threadwatch logo seochat tools logo