Web Analytics Made Easy - Statcounter
Skip to content

Tabs

Tabs bring not only an extra level of sophistication to your window layout, they give you extra room to add more elements. Tabs are one of the 3 container Elements, Elements that hold or contain other Elements. The other two are the Column and Frame Elements.

tabs

import PySimpleGUI as sg    

tab1_layout =  [[sg.T('This is inside tab 1')]]    

tab2_layout = [[sg.T('This is inside tab 2')],    
               [sg.In(key='in')]]    

layout = [[sg.TabGroup([[sg.Tab('Tab 1', tab1_layout, tooltip='tip'), sg.Tab('Tab 2', tab2_layout)]], tooltip='TIP2')],    
          [sg.Button('Read')]]    

window = sg.Window('My window with tabs', layout, default_element_size=(12,1))    

while True:    
    event, values = window.read()    
    print(event,values)    
    if event == sg.WIN_CLOSED:           # always,  always give a way out!    
        break