from Tkinter import * from Dialog import Dialog class OldDialogDemo(Frame): def __init__(self, master=None): Frame.__init__(self, master) Pack.config(self) # same as self.pack() Button(self, text='Pop1', command=self.dialog1).pack() Button(self, text='Pop2', command=self.dialog2).pack() def dialog1(self): ans = Dialog(self, title = 'Popup Fun!', text = 'An example of a popup-dialog ' 'box, using older "Dialog.py".', bitmap = 'questhead', default = 0, strings = ('Yes', 'No', 'Cancel')) if ans.num == 0: self.dialog2() def dialog2(self): Dialog(self, title = 'HAL-9000', text = "I'm afraid I can't let you do that, Dave...", bitmap = 'hourglass', default = 0, strings = ('spam', 'SPAM')) if __name__ == '__main__': OldDialogDemo().mainloop()