def __init__(self, master, **kw): Toplevel.__init__(self, master, **kw) self.style = Style() self.withdraw() x = self.master.winfo_rootx() y = self.master.winfo_rooty() loadIcon(self.tk, self, IIVLXICO) self.title(self.WINDOW_TITLE) self.resizable(*self.WINDOW_RESIZABLE) self.geometry(f'{self.WINDOW_WIDTH}x{self.WINDOW_HEIGHT}+{x}+{y}') # grid configure self.grid_rowconfigure(0, weight=1) self.grid_rowconfigure(1, weight=0) self.grid_rowconfigure(2, weight=1) self.grid_columnconfigure(0, weight=1) self.grid_columnconfigure(1, weight=0) self.grid_columnconfigure(2, weight=0) # set window as transient and display self.transient(self.master) self.focus_set() self.grab_set() self.deiconify() # draw the window\ self.configureStyles() self.draw() # wait for the window to close and return to master self.wait_window()
def __init__(self, master, **kw): Frame.__init__(self, master, **kw) self.style = Style() self.configure() loadIcon(self.master, self.master, IIVLXICO) self.master.title(self.WINDOW_TITLE) self.master.resizable(*self.WINDOW_RESIZABLE) x = self.master.winfo_pointerx() - self.WINDOW_WIDTH_OFFSET y = self.master.winfo_pointery() - self.WINDOW_HEIGHT_OFFSET y = y if y > self.WINDOW_Y_MIN else self.WINDOW_Y_MIN self.master.geometry( f'{self.WINDOW_WIDTH}x{self.WINDOW_HEIGHT}+{x}+{y}') self.master.minsize(self.WINDOW_WIDTH_MIN, self.WINDOW_HEIGHT_MIN) # configure master grid self.master.grid_rowconfigure(0, weight=1) self.master.grid_columnconfigure(0, weight=1) # place the window self.grid(row=0, column=0, sticky='news') #configure grid self.grid_rowconfigure(0, weight=1) self.grid_rowconfigure(1, weight=1) self.grid_rowconfigure(2, weight=1) self.grid_rowconfigure(2, weight=0) self.grid_columnconfigure(0, weight=1) self.grid_columnconfigure(1, weight=1) self.grid_columnconfigure(2, weight=1) self.grid_columnconfigure(2, weight=2) # subwindows self.memoryview = None # draw the window self.createMenubar() self.createContextMenu() self.draw() self.setBinds()
def __init__(self, master, **kw): Toplevel.__init__(self, master, **kw) self.style = Style() self.withdraw() x = self.master.winfo_rootx() + self.WINDOW_WIDTH_OFFSET y = self.master.winfo_rooty() + self.WINDOW_HEIGHT_OFFSET loadIcon(self.tk, self, IIVLXICO) self.title(self.WINDOW_TITLE) self.geometry('{0:d}x{1:d}+{2:d}+{3:d}'.format(self.WINDOW_WIDTH, self.WINDOW_HEIGHT, x, y)) self.resizable(False, False) self.minsize(self.WINDOW_WIDTH_MIN, self.WINDOW_HEIGHT_MIN) #grid configure self.grid_columnconfigure(0, weight=1) self.grid_rowconfigure(0, weight=1) self.grid_rowconfigure(1, weight=0) #self.wait_visibility() #self.transient(self.master) #self.focus_set() #self.grab_set() self.deiconify() # configure memory self.engine = self.master.engine # draw this window self.configureStyles() self.draw()