PySimpleGUI的零边距布局

问题描述

我正在尝试使用PySimpleGui在Python中创建一个上下左右空白为零的布局。

示例代码

this.sceneObject.worldTransform

代码结果

enter image description here

问题

关于如何删除左,右和上边距的任何想法?这样文本将对齐到坐标x = 0,y = 0,而没有蓝色边距吗?

是否可以使用某种偏移量或仅使用认保证金参数来解决

解决方法

  • 文本→不填充:pad=(0,0)
  • 窗口→无边距:margins=(0,0)
layout = [[sg.Text('Text with background color',background_color='#FF0000',pad=(0,0))]]
window = sg.Window('Title',layout,size=(200,200),margins=(0,0))

Zero margin layout