需要帮助使用 PySimpleGUI
Need help using PySimpleGUI
我需要组织我的 window,使图像位于右侧并且不影响左侧的元素。非常感谢您的帮助。
enter image description here
两种方式
- 框架顶部对齐
import PySimpleGUI as sg
layout = [
[sg.Frame('myFrame', layout=[
[sg.Text('Text 1')],
[sg.Text('Text 2')],
[sg.Button('A button')]], vertical_alignment='top'),
sg.Image(filename='img.png'),
]
]
window = sg.Window('Hello', layout).read(close=True)
- 展开与图片高度相同的框架
import PySimpleGUI as sg
layout = [
[sg.Frame('myFrame', layout=[
[sg.Text('Text 1')],
[sg.Text('Text 2')],
[sg.Button('A button')]], expand_y=True),
sg.Image(filename='img.png'),
]
]
window = sg.Window('Hello', layout).read(close=True)
我需要组织我的 window,使图像位于右侧并且不影响左侧的元素。非常感谢您的帮助。
enter image description here
两种方式
- 框架顶部对齐
import PySimpleGUI as sg
layout = [
[sg.Frame('myFrame', layout=[
[sg.Text('Text 1')],
[sg.Text('Text 2')],
[sg.Button('A button')]], vertical_alignment='top'),
sg.Image(filename='img.png'),
]
]
window = sg.Window('Hello', layout).read(close=True)
- 展开与图片高度相同的框架
import PySimpleGUI as sg
layout = [
[sg.Frame('myFrame', layout=[
[sg.Text('Text 1')],
[sg.Text('Text 2')],
[sg.Button('A button')]], expand_y=True),
sg.Image(filename='img.png'),
]
]
window = sg.Window('Hello', layout).read(close=True)