Making Windows Larger in Tkinter

Doran, Harold HDoran at air.org
Fri Apr 18 11:15:30 EDT 2008


Thanks to some help I received on list the other day, I now have a very
nice windows-based application that implements multiple programs. This
is a very powerful tool. Now I am working to make this window pretty.
One problem I cannot find help on is how to make the windows a certain
size. For example, I have added in a root.title() with a lot of text in
the file example.py below.

Is it possible to make the window box a specific size, or by default,
always be large enough to show the entire text in root.title? 

example.py
from Tkinter import *
import tkMessageBox

def callback():
    print "called the callback!"

def message():
    if tkMessageBox.askokcancel("Quit", "Do you really wish to quit?"):
        root.destroy()

def about():
    tkMessageBox.showinfo("About", "Foo?")
    
root = Tk()
root.title('Hello World: How Can we see the entire title?')

# create a menu
menu = Menu(root)
root.config(menu=menu)

filemenu = Menu(menu)
menu.add_cascade(label="File", menu=filemenu)
filemenu.add_command(label="New", command=message)
filemenu.add_command(label="Open...", command=callback)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=message)

helpmenu = Menu(menu)
menu.add_cascade(label="Help", menu=helpmenu)
helpmenu.add_command(label="About...", command=about)

mainloop()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080418/edc717d8/attachment.html>


More information about the Python-list mailing list