Skip to content

[Question] How to resize elements as window resized ? #3952

@RRadziejewski

Description

@RRadziejewski

Type of issue: Question

Output of ;

print(sg.version) 4.34.0 Released 18-Jan-2021

print(sg.tclversion_detailed) 8.6.9

print(sg.sys.version) 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)]

Ports = tkinter

import PySimpleGUI as sg

tab1_layout =  [[sg.Text('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), sg.Tab('Tab 2', tab2_layout)]])],
              [sg.Button('Read')]] 
window = sg.Window('Window Title', layout, resizable=True)

# Event Loop to process "events"
while True:             
    event, values = window.read()
    if event in (sg.WIN_CLOSED, 'Cancel'):
        break

window.close()
## Paste your code here

My question is can i make it all resizable ? Like all the tabs and every element in tab ? It would be very helpfull to have such a snippet as a kickstarter. Is that even possible to do it automatically with some properties being set on tabs ?
Because for now i can just resize top level window

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions