Python Forum
Tkinter: multitab window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tkinter: multitab window
Hi, I'm trying to use multitab frame in my script. My plan is to create the pages I need in different .py then use this as main page to start my program

from tkinter import *
from Page1 import *
from Page2 import *
from Page3 import *class App(Tk):

    def __init__(self,*args,**kwargs):
       self.notebook = ttk.Notebook()
    def add_tab(self):
        tab1 = Instructions(self.notebook)
        tab2 = Mainframe(self.notebook)
        tab3 = Test(self.notebook)
class Page1(Frame):
   def __init__(self,name,*args,**kwargs):
       Frame.__init__(self,*args,**kwargs) = name
class Page2(Frame):
   def __init__(self,name,*args,**kwargs):
       Frame.__init__(self,*args,**kwargs) = name
class Page3(Frame):
   def __init__(self,name,*args,**kwargs):
       Frame.__init__(self,*args,**kwargs) = name
my_app = App()
but when I try to make it run all pages appear in different windows and only after I close them finally appear the window with my tab (that are empty). How can I fix this?

This is my first page code:
from openpyxl import *
from tkinter import *
from datetime import datetime
wb = load_workbook('C:\\Users\\MyPC\\Desktop\\\\exc.xlsx')

sheet =
datetimeFormat = '%d-%m-%Y'
class Page1(Frame):

   def __init__(self,master,*args,**kwargs):
       global msg, inv_cnt



class App(Tk):
   def __init__(self):
       global value
       self.title("Fake News Survey")
               # create and pack a Mainframe window
and my second one
from tkinter import *

S = Scrollbar(window)
T = Text(window, padx = 10, pady = 10, spacing1 = 10, spacing2 = 1, bd = 2)
S.pack(side=RIGHT, fill=Y)
T.pack(side=LEFT, expand=True, fill=BOTH)
T.config(yscrollcommand=S.set, background="LIGHT GRAY")
T.tag_configure('big', font=('times', 15, 'bold'), justify='center')
T.tag_configure('normal', font=('times', 12))
T.insert(END,'Instructions\n', 'big')
quote = """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin id augue tempor lectus ornare mollis at sed felis."""
T.insert(END, quote, 'normal')

Basically I don't know how to format my page to be able to fit in the multitab and how to call it in my main page. Also how could I disable a tab and then able it after the use of a button?
Thank to whoever could help me Smile

Messages In This Thread
Tkinter: multitab window - by WizardMitMagi - Apr-19-2020, 11:37 AM
RE: Tkinter: multitab window - by deanhystad - Apr-19-2020, 03:12 PM
RE: Tkinter: multitab window - by WizardMitMagi - Apr-29-2020, 08:27 AM
RE: Tkinter: multitab window - by deanhystad - Apr-29-2020, 02:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  function in new window (tkinter) Dale22 7 168 Nov-24-2020, 11:28 PM
Last Post: Dale22
  Scrollable big image in a window (TKinter) Prospekteur 3 262 Sep-14-2020, 03:06 AM
Last Post: Larz60+
  Run more than one window together with tkinter SmukasPlays 1 257 Aug-24-2020, 05:00 PM
Last Post: Larz60+
  Adding an image to a tkinter window djwilson0495 2 781 Aug-23-2020, 11:07 AM
Last Post: ebolisa
  [Tkinter] calling a new window from a tkinter window neuroprogrammer 2 344 Jul-28-2020, 10:59 PM
Last Post: deanhystad
  How to display results from terminal window onto tkinter. buttercup 0 234 Jul-21-2020, 04:41 AM
Last Post: buttercup
  tkinter.TclError: bad window path name kenwatts275 3 1,626 Apr-26-2020, 08:16 PM
Last Post: kenwatts275
  Using Tkinter widgets on child window chewy1418 8 1,593 Feb-27-2020, 10:34 PM
Last Post: Marbelous
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 1,366 Jan-23-2020, 09:00 PM
Last Post: HBH
  [Tkinter] Mouse click event not working on multiple tkinter window evrydaywannabe 2 1,010 Dec-16-2019, 04:47 AM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020