hey guys, girls, others. i have a pop down widget and one of the options in the pop down screen is "Exit" which means quit. I want to know the code for clicking that "Exit" option and then it Quiting the whole program. here is my code for the pop down window with "Exit" option:

......

def createQuit(self):
self.mb = Menubutton(self, text="Quit", relief=FLAT, font=("Arial", 8))
self.mb.grid(row=0, column=3)
self.mb.menu = Menu(self.mb, tearoff=0)
self.mb["menu"] = self.mb.menu
self.exitVar = IntVar()
self.mb.menu.add_checkbutton(label="Exit", variable=self.helpTopicsVar)

......

If you don't know what im talking about please comment back!!

:]

No one is going to help you without knowing which f---- GUI toolkit you are using, and code posted between code tags --> click on the [ code ] icon at the top of the box, and post your code between the two code tags.

Edited 6 Years Ago by woooee: n/a

hey guys, girls, others. i have a pop down widget and one of the options in the pop down screen is "Exit" which means quit. I want to know the code for clicking that "Exit" option and then it Quiting the whole program. here is my code for the pop down window with "Exit" option:

def createQuit(self):
self.mb = Menubutton(self, text="Quit", relief=FLAT, font=("Arial", 8))
self.mb.grid(row=0, column=3)
self.mb.menu = Menu(self.mb, tearoff=0)
self.mb["menu"] = self.mb.menu
self.exitVar = IntVar()
self.mb.menu.add_checkbutton(label="Exit", variable=self.helpTopicsVar)

......

If you don't know what im talking about please comment back!!

:]

hello

here is the code, help me make a pop down window become a quit button!!

def createQuit(self):
        self.mb = Menubutton(self, text="Quit", relief=FLAT, font=("Arial", 8))
        self.mb.grid(row=0, column=3)
        self.mb.menu = Menu(self.mb, tearoff=0)
        self.mb["menu"] = self.mb.menu
        self.exitVar = IntVar()
        self.mb.menu.add_checkbutton(label="Exit", variable=self.helpTopicsVar)
self.mb["menu"] = self.mb.menu
        self.mb.menu.add_checkbutton(label="Exit", command=self.quit)

quit() stops the mainloop and destroy() destroys the parent window and it's descendants.

He is using Tkinter. I recognized the methods and keywords.

But not everyone uses/have ever use TKinter. One of them is myself.
Unless I see import TkInter, pack(), I will barely understand ;)

But not everyone uses/have ever use TKinter. One of them is myself.
Unless I see import TkInter, pack(), I will barely understand ;)

And I'm the same way with any GUI toolkit other than Tkinter, unless I see the import of course.

This article has been dead for over six months. Start a new discussion instead.