python - Custom Dialog in tkinter -


i trying make custom popup dialog box using tkinter in python. custom mean having several buttons text want. closest trying code

from tkinter import * dialog import dialog   class olddialogdemo(frame):     def __init__(self, master=none):         frame.__init__(self, master)         pack.config(self)  # same 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 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 can't let that, dave...",                      bitmap='hourglass',                      default=0, strings=('spam', 'spam'))  olddialogdemo().mainloop() 

(source: programming python mark lutz 4th edition published o'reilly media, inc.) problem cant find documentation on it. btw why old dialog? deprecated or something? ps. found out if import tkmessagebox above dialog not appear?? have old part?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -