A Simple Menu , Stretching the Window Width--Tkinter

John Posner jjposner at snet.net
Tue Mar 3 15:36:37 EST 2009


 >> 
 >> 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/



More information about the Python-list mailing list