File: multi_app.py

package info (click to toggle)
python-guizero 1.1.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,676 kB
  • sloc: python: 6,286; makefile: 28; sh: 17
file content (20 lines) | stat: -rw-r--r-- 547 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from guizero import *

# it is possible to create multiple apps
# guizero will present a warning as you should use Window()
# to create multi window applications

def check(window):
    print("app {} clicked".format(window))
    print("1 - txt={} ".format(tb1.value))
    print("2 - txt={} ".format(tb2.value))

app1 = App(title="App 1")
tb1 = TextBox(app1, grid=[0, 1])
pb1 = PushButton(app1, command=check, args = [1])

app2 = App(title="App 2")
tb2 = TextBox(app2, grid=[0, 1])
pb2 = PushButton(app2, command=check, args = [2])

app1.display()