A Simple Menu , Stretching the Window Width--Tkinter

Discussion in 'Python' started by W. eWatson, Mar 3, 2009.

  1. W. eWatson

    W. eWatson Guest

    I'd like to create a simple Menu bar with one item in it, say, called "My
    Menu", and have a few submenu items on it like "Change Data" and "Exit". I
    can do that but I'd like the title I put on the enclosing window to be
    completely visible. The title is, for example, "Hello, out there. This is a
    simple menu". Presently the window shrinks in width the accommodate "My
    Menu", and I see "Hello, out th". How do I force the width to accommodate
    the whole title?
    --
    W. eWatson

    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <www.speckledwithstars.net/>
     
    W. eWatson, Mar 3, 2009
    #1
    1. Advertising

  2. W. eWatson

    John Posner Guest

    >>
    >> I'd like to create a simple Menu bar with one item in it,
    >> say, called "My
    >> Menu", and have a few submenu items on it like "Change
    >> Data" and "Exit". I
    >> can do that but I'd like the title I put on the enclosing
    >> window to be
    >> completely visible. The title is, for example, "Hello, out
    >> there. This is a
    >> simple menu". Presently the window shrinks in width the
    >> accommodate "My
    >> Menu", and I see "Hello, out th". How do I force the width
    >> to accommodate
    >> the whole title?


    If you're having trouble with the size of the overall ("root" or "toplevel")
    window, this might help:

    rootwin = Tk()
    # width=500, height=350, upper-left-corner at (50,50) -- revise to suit
    rootwin.geometry('500x350+50+50')
    rootwin.resizable(False, False)
    rootwin.title("Hello, out there")

    -John





    E-mail message checked by Spyware Doctor (6.0.0.386)
    Database version: 5.11880
    http://www.pctools.com/en/spyware-doctor-antivirus/
     
    John Posner, Mar 3, 2009
    #2
    1. Advertising

  3. W. eWatson

    W. eWatson Guest

    John Posner wrote:
    > >>
    > >> I'd like to create a simple Menu bar with one item in it,
    > >> say, called "My
    > >> Menu", and have a few submenu items on it like "Change
    > >> Data" and "Exit". I
    > >> can do that but I'd like the title I put on the enclosing
    > >> window to be
    > >> completely visible. The title is, for example, "Hello, out
    > >> there. This is a
    > >> simple menu". Presently the window shrinks in width the
    > >> accommodate "My
    > >> Menu", and I see "Hello, out th". How do I force the width
    > >> to accommodate
    > >> the whole title?

    >
    > If you're having trouble with the size of the overall ("root" or "toplevel")
    > window, this might help:
    >
    > rootwin = Tk()
    > # width=500, height=350, upper-left-corner at (50,50) -- revise to suit
    > rootwin.geometry('500x350+50+50')
    > rootwin.resizable(False, False)
    > rootwin.title("Hello, out there")
    >
    > -John
    >
    >
    >
    >
    >
    > E-mail message checked by Spyware Doctor (6.0.0.386)
    > Database version: 5.11880
    > http://www.pctools.com/en/spyware-doctor-antivirus/

    Yep, that works. Thanks.

    --
    W. eWatson

    (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
    Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

    Web Page: <www.speckledwithstars.net/>
     
    W. eWatson, Mar 4, 2009
    #3
    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. AndrewF
    Replies:
    1
    Views:
    844
    Bruce Barker
    Oct 10, 2005
  2. Replies:
    11
    Views:
    1,126
    Toby Inkster
    Jan 28, 2005
  3. mariox19
    Replies:
    0
    Views:
    858
    mariox19
    Dec 30, 2004
  4. Replies:
    0
    Views:
    431
  5. Hoa

    Horizontal menu with same width menu items

    Hoa, Aug 30, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    281
Loading...

Share This Page