(self, parent, title, message, *, text0='', used_names={},
                 _htest=False, _utest=False)
Create modal popup, return when destroyed.

        Additional subclass init must be done before this unless
        _utest=True is passed to suppress wait_window().

        title - string, title of popup dialog
        message - string, informational message to display
        text0 - initial value for entry
        used_names - names already in use
        _htest - bool, change box location when running htest
        _utest - bool, leave window hidden and not modal
Create modal popup, return when destroyed.
Create modal popup return when destroyed .
def __init__(self, parent, title, message, *, text0='', used_names={},
                 _htest=False, _utest=False):
        """Create modal popup, return when destroyed.

        Additional subclass init must be done before this unless
        _utest=True is passed to suppress wait_window().

        title - string, title of popup dialog
        message - string, informational message to display
        text0 - initial value for entry
        used_names - names already in use
        _htest - bool, change box location when running htest
        _utest - bool, leave window hidden and not modal
        """
        self.parent = parent  # Needed for Font call.
        self.message = message
        self.text0 = text0
        self.used_names = used_names

        Toplevel.__init__(self, parent)
        self.withdraw()  # Hide while configuring, especially geometry.
        self.title(title)
        self.transient(parent)
        if not _utest:  # Otherwise fail when directly run unittest.
            self.grab_set()

        _setup_dialog(self)
        if self._windowingsystem == 'aqua':
            self.bind("<Command-.>", self.cancel)
        self.bind('<Key-Escape>', self.cancel)
        self.protocol("WM_DELETE_WINDOW", self.cancel)
        self.bind('<Key-Return>', self.ok)
        self.bind("<KP_Enter>", self.ok)

        self.create_widgets()
        self.update_idletasks()  # Need here for winfo_reqwidth below.
        self.geometry(  # Center dialog over parent (or below htest box).
                "+%d+%d" % (
                    parent.winfo_rootx() +
                    (parent.winfo_width()/2 - self.winfo_reqwidth()/2),
                    parent.winfo_rooty() +
                    ((parent.winfo_height()/2 - self.winfo_reqheight()/2)
                    if not _htest else 150)
                ) )
        self.resizable(height=False, width=False)

        if not _utest:
            self.deiconify()  # Unhide now that geometry set.
            self.wait_window()
def __init__ ( self , parent , title , message , * , text0 = '' , used_names = { } , _htest = False , _utest = False ) : self . parent = parent # Needed for Font call. self . message = message self . text0 = text0 self . used_names = used_names Toplevel . __init__ ( self , parent ) self . withdraw ( ) # Hide while configuring, especially geometry. self . title ( title ) self . transient ( parent ) if not _utest : # Otherwise fail when directly run unittest. self . grab_set ( ) _setup_dialog ( self ) if self . _windowingsystem == 'aqua' : self . bind ( "<Command-.>" , self . cancel ) self . bind ( '<Key-Escape>' , self . cancel ) self . protocol ( "WM_DELETE_WINDOW" , self . cancel ) self . bind ( '<Key-Return>' , self . ok ) self . bind ( "<KP_Enter>" , self . ok ) self . create_widgets ( ) self . update_idletasks ( ) # Need here for winfo_reqwidth below. self . geometry ( # Center dialog over parent (or below htest box). "+%d+%d" % ( parent . winfo_rootx ( ) + ( parent . winfo_width ( ) / 2 - self . winfo_reqwidth ( ) / 2 ) , parent . winfo_rooty ( ) + ( ( parent . winfo_height ( ) / 2 - self . winfo_reqheight ( ) / 2 ) if not _htest else 150 ) ) ) self . resizable ( height = False , width = False ) if not _utest : self . deiconify ( ) # Unhide now that geometry set. self . wait_window ( )