Function calling problem

Colin J. Williams cjw at
Tue Aug 31 09:03:16 EDT 1999

I've made a couple of changes.  I hope this helps.

Colin W.

          rainer2207 at

Sun 5:57 AM

          Function calling problem

Can someone please explain what's wrong with this code? I've tried to
call the function quit(self) but I get an error. What's wrong here?

from Tkinter import *
import sys, Dialog

class Interface:

        def __init__(self, master):

       = Menu(master, tearoff=0, name="menu")

                self.frame = Frame(master, width="15c", height="10c",
bd=2, relief="sunken")
                self.frame.pack(fill="both", expand=1)

                m = Menu(, tearoff=0)
      "File", menu=m, underline=0)

                n = Menu(m, tearoff=0)
                m.add_cascade(label="New", menu=n, underline=0)
                n.add_command(label="RDF Schema", underline=4)
                n.add_command(label="RDF Metadata", underline=4)

                o = Menu(m, tearoff=0)
                m.add_cascade(label="Open", menu=n, underline=0)
                o.add_command(label="RDF Schema", underline=5)
                o.add_command(label="RDF Metadata", underline=5,

                m.add_command(label="Save", underline=0)
                m.add_command(label="Save As...", underline=5)
                m.add_command(label="Close", underline=0)
                m.add_command(label="Exit", underline=0,

                m = Menu(m, tearoff=0)
      "Edit", menu=m, underline=0)
                m.add_command(label="Cut", underline=2)
                m.add_command(label="Copy", underline=0)
                m.add_command(label="Paste", underline=0)

                m = Menu(m, tearoff=0)
      "Help", menu=m, underline=0)
                a = Menu(m, tearoff=0)
                m.add_command(label="About", underline=0)

        def quit(self):
                print 'Exit'
                root.destroy()                                     #

        def open(self):                                            #
          print 'What is this supposed to do?'

root = Tk()
inter = Interface(root)

More information about the Python-list mailing list