I have a question. I import a module into the main window A which opens in a separate window B. Both windows have dimensions I have imposed. How do I position window B relative to A? Currently, window B appears in the upper right corner when called and I want to have it in the middle of window A. Thank you for your help :D
def get_gallery(self):
from GUI.module.gallery import Gallery
Gallery(tk.Toplevel(self.root)).pack(fill=tk.BOTH, expand=1)
def get_run_gallery(self):
jpg = tk.Button(self.frame, text="Gallery", command=self.get_gallery)
self.my_canvas.create_window(780, 220, anchor="nw", window=jpg, height=50, width=200)
After changes
def get_gallery(self):
from GUI.module.gallery import Gallery
Gallery(tk.Toplevel(self.root)).pack(fill=tk.BOTH, expand=1)
x = self.root.winfo_x()
y = self.root.winfo_y()
tk.Toplevel(self.root).geometry("+%d+%d" % (x + 600, y + 800))
I further have another question, with this code I have two Gallery windows open and an offset blank window, and I want to offset Gallery, how to correct this code? Thx for your help :D