TKinter is driving me crazy!

Daniel Yoo dyoo at hkn.eecs.berkeley.edu
Tue Sep 2 04:31:51 EDT 2003


Cousin Stanley <CousinStanley at hotmail.com> wrote:
: |     import Tkinter as tk
: |
: |    class GuessWidget(tk.Frame):
: |        def __init__(self, value, *args, **kw):
: |
: |            tk.Frame.__init__(self, *args, **kw)
: | ....

: Jp ....

:    Thanks for posting this example script ....

:    How does one change the  title
:    of the sub-classed frame ????


Hi Stanley,

Frames don't have titles, but toplevels do.  Try using the 'title()'
method of the toplevel widget.  For example:

###
from Tkinter import *
root = Tk()
root.title("Hello world!")
frame = Frame(root)
Label(frame, text="This is a test!   Hello!  Can you see this?").pack()
frame.pack()
mainloop()
###

There's more information on this from Fredrik Lundh's "An Introduction
to Tkinter".

    http://www.pythonware.com/library/tkinter/introduction/x9843-style-methods.htm

Hope this helps!




More information about the Python-list mailing list