2

I am trying to make a layout with zero top, left and right margin in Python with PySimpleGui.

Example code

import PySimpleGUI as sg

layout = [[sg.Text('Text with background color', background_color='#FF0000')]]
window = sg.Window('Title', layout, size=(200, 200))

Code result

enter image description here

Question

Any ideas on how to remove the left, right, and the top margin? So the text would be aligned to coordinates x=0, y=0 without the blue margin?

Could it be solved with some kind of offset or just a default-margin parameter?

RedHawkDK
  • 119
  • 1
  • 4
  • 9

1 Answers1

1
  • Text → no padding: pad=(0,0)
  • Window → no margin: 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

rolegic
  • 11
  • 3