Dec-03-2019, 08:40 PM
(This post was last modified: Dec-03-2019, 08:52 PM by JackMack118.)
Hello all.
I'm trying to get a PanedWindow to have tabs in it. I'm so close but I think my confusion with __init__ is getting me.
I have two examples that have me near, yet so far away.
This example here is closer to what I want, but not working out.
![[Image: vvvv.png]](https://i.ibb.co/y5YZr9X/vvvv.png)
--------------------------------------------------------------------------------------------
The Entry widget loses its PanedWindow capability
This example here the PanedWindows work, though I want the right panal to be in the first tab, then subsequently put panedWindow on the second tab.
![[Image: vvvv2.png]](https://i.ibb.co/7gSDLdn/vvvv2.png)
Thanks for any help, being a noob sucks lol.
This might help show the vision, or perhaps confuse it more Idk lol.
I'm trying to get a PanedWindow to have tabs in it. I'm so close but I think my confusion with __init__ is getting me.
I have two examples that have me near, yet so far away.
This example here is closer to what I want, but not working out.
![[Image: vvvv.png]](https://i.ibb.co/y5YZr9X/vvvv.png)
--------------------------------------------------------------------------------------------
The Entry widget loses its PanedWindow capability
class MainApplication(tk.Frame): def __init__(self, parent, *args, **kwargs): # super(Frame, self).__init__() tk.Frame.__init__(self, parent, *args, **kwargs) # ttk.Label.__init__(self, parent) self.parent = parent self.w1 = tk.PanedWindow() self.w1.pack(fill = tk.BOTH, expand = 1) self.left = tk.Entry(self.w1, bd = 3) self.w1.add(self.left) self.w2 = tk.PanedWindow(self.w1, orient = tk.VERTICAL) self.w1.add(self.w2) # ------------------------------------------------------------------------- self.TAB_CONTROL = ttk.Notebook(self.w2) self.TAB1 = ttk.Frame(self.TAB_CONTROL) self.TAB_CONTROL.add(self.TAB1, text='Tab 1') self.TAB2 = ttk.Frame(self.TAB_CONTROL) self.TAB_CONTROL.add(self.TAB2, text='Tab 2') self.TAB_CONTROL.pack(expand=1, fill="both") ttk.Label(self.TAB1, text="This is Tab 1").grid(column=0, row=0, padx=10, pady=10) # ttk.Label(self.TAB2, text="This is Tab 2").grid(column=0, row=0, padx=10, pady=10) # -------------------------------------------------------------------------- tk.Entry(self.TAB1).grid(column=0, row=1, padx=10, pady=10) # self.e2 = tk.Entry(self.w2) # self.w2.add(self.e1) # self.w2.add(self.e2) # self.bottom = tk.Button(self.w2, text = "Add") # self.w2.add(self.bottom) if __name__ == "__main__": root = tk.Tk() MainApplication(root).pack() root.mainloop()-----------------------------------------------------------------------------------
This example here the PanedWindows work, though I want the right panal to be in the first tab, then subsequently put panedWindow on the second tab.
![[Image: vvvv2.png]](https://i.ibb.co/7gSDLdn/vvvv2.png)
class MainApplication(tk.Frame): def __init__(self, parent, *args, **kwargs): # super(Frame, self).__init__() tk.Frame.__init__(self, parent, *args, **kwargs) # ttk.Label.__init__(self, parent) self.parent = parent # ------------------------------------------------------------------------- self.TAB_CONTROL = ttk.Notebook(self.parent) self.TAB1 = ttk.Frame(self.TAB_CONTROL) self.TAB_CONTROL.add(self.TAB1, text='Tab 1') self.TAB2 = ttk.Frame(self.TAB_CONTROL) self.TAB_CONTROL.add(self.TAB2, text='Tab 2') self.TAB_CONTROL.pack(expand=1, fill="both") ttk.Label(self.TAB1, text="This is Tab 1").grid(column=0, row=0, padx=10, pady=10) ttk.Label(self.TAB2, text="This is Tab 2").grid(column=0, row=0, padx=10, pady=10) # --------------------------------------------------------------------------- self.w1 = tk.PanedWindow() self.w1.pack(fill = tk.BOTH, expand = 1) self.left = tk.Entry(self.w1, bd = 5) self.w1.add(self.left) self.w2 = tk.PanedWindow(self.w1, orient = tk.VERTICAL) self.w1.add(self.w2) self.e1 = tk.Entry(self.w2) self.e2 = tk.Entry(self.w2) self.w2.add(self.e1) self.w2.add(self.e2) self.bottom = tk.Button(self.w2, text = "Add") self.w2.add(self.bottom) if __name__ == "__main__": root = tk.Tk() MainApplication(root).pack() root.mainloop()What I'm trying to get it looking like the first image, but with the panaledwindow in it working correctly.
Thanks for any help, being a noob sucks lol.
This might help show the vision, or perhaps confuse it more Idk lol.
![[Image: vvvv3.png]](https://i.ibb.co/zrfCCMY/vvvv3.png)