jl_678

Pysimplegui #1

Oct 20th, 2020
919
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import PySimpleGUI as sg
  2. layout = [
  3.                 [sg.Graph(canvas_size=(5000, 300),
  4.                           graph_bottom_left=(0, 0),
  5.                           graph_top_right=(400, 400),
  6.                           background_color='green',
  7.                           key='graph')]
  8.         ]
  9. sg.theme('Dark Blue 3')
  10. window = sg.Window('Window Title', layout, finalize=True)
  11. window.Maximize()
  12. graph = window['graph']
  13. graph.DrawText(text='FREE',
  14.                location=(85, 150),
  15.                color='black',
  16.                font='Courier 48')
  17. # window['graph'].update(background_color='blue')
  18. # Event Loop to process "events" and get the "values" of the inputs
  19. while True:
  20.         event, values = window.read()
  21.         if event == sg.WIN_CLOSED: # if user closes window or clicks cancel
  22.                 break
  23.         window['graph'].update(background_color='blue')
  24. window.close()
RAW Paste Data