(self, parent, title = None)
Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
Initialize a dialog.
Initialize a dialog .
def __init__(self, parent, title = None):
        '''Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        '''
        master = parent
        if master is None:
            master = _get_temp_root()

        Toplevel.__init__(self, master)

        self.withdraw() # remain invisible for now
        # If the parent is not viewable, don't
        # make the child transient, or else it
        # would be opened withdrawn
        if parent is not None and parent.winfo_viewable():
            self.transient(parent)

        if title:
            self.title(title)

        _setup_dialog(self)

        self.parent = parent

        self.result = None

        body = Frame(self)
        self.initial_focus = self.body(body)
        body.pack(padx=5, pady=5)

        self.buttonbox()

        if self.initial_focus is None:
            self.initial_focus = self

        self.protocol("WM_DELETE_WINDOW", self.cancel)

        _place_window(self, parent)

        self.initial_focus.focus_set()

        # wait for window to appear on screen before calling grab_set
        self.wait_visibility()
        self.grab_set()
        self.wait_window(self)
def __init__ ( self , parent , title = None ) : master = parent if master is None : master = _get_temp_root ( ) Toplevel . __init__ ( self , master ) self . withdraw ( ) # remain invisible for now # If the parent is not viewable, don't # make the child transient, or else it # would be opened withdrawn if parent is not None and parent . winfo_viewable ( ) : self . transient ( parent ) if title : self . title ( title ) _setup_dialog ( self ) self . parent = parent self . result = None body = Frame ( self ) self . initial_focus = self . body ( body ) body . pack ( padx = 5 , pady = 5 ) self . buttonbox ( ) if self . initial_focus is None : self . initial_focus = self self . protocol ( "WM_DELETE_WINDOW" , self . cancel ) _place_window ( self , parent ) self . initial_focus . focus_set ( ) # wait for window to appear on screen before calling grab_set self . wait_visibility ( ) self . grab_set ( ) self . wait_window ( self )