Skip to content
Permalink
Browse files

Merge pull request #2595 from PySimpleGUI/Dev-latest

Added test to show using Tab.select()
  • Loading branch information
PySimpleGUI committed Feb 10, 2020
2 parents 3dd0aa3 + 9308bb3 commit 5959bceccef5d9f86346345a944efa30855d0218
Showing with 4 additions and 7 deletions.
  1. +4 −7 DemoPrograms/Demo_Tabs_Simple.py
@@ -17,19 +17,14 @@
tab_group_layout = [[sg.Tab('Tab 1', tab1_layout, font='Courier 15', key='-TAB1-'),
sg.Tab('Tab 2', tab2_layout, visible=False, key='-TAB2-'),
sg.Tab('Tab 3', tab3_layout, key='-TAB3-'),
sg.Tab('Tab 4', tab3_layout, visible=False, key='-TAB4-'),

sg.Tab('Tab 4', tab4_layout, visible=False, key='-TAB4-'),
]]

# The window layout - defines the entire window
layout = [[sg.TabGroup(tab_group_layout,
# selected_title_color='blue',
# selected_background_color='red',
# tab_background_color='green',
enable_events=True,
# font='Courier 18',
key='-TABGROUP-')],
[sg.Text('Make tab number'), sg.Input(key='-IN-', size=(3,1)), sg.Button('Invisible'), sg.Button('Visible')]]
[sg.Text('Make tab number'), sg.Input(key='-IN-', size=(3,1)), sg.Button('Invisible'), sg.Button('Visible'), sg.Button('Select')]]

window = sg.Window('My window with tabs', layout, no_titlebar=False)

@@ -44,5 +39,7 @@
window[tab_keys[int(values['-IN-'])-1]].update(visible=False)
if event == 'Visible':
window[tab_keys[int(values['-IN-'])-1]].update(visible=True)
if event == 'Select':
window[tab_keys[int(values['-IN-'])-1]].select()

window.close()

0 comments on commit 5959bce

Please sign in to comment.
You can’t perform that action at this time.