File: multi_window.py

package info (click to toggle)
python-guizero 0.6.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,820 kB
  • sloc: python: 5,376; makefile: 28; sh: 17
file content (23 lines) | stat: -rw-r--r-- 625 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from guizero import App, Window, PushButton

app = App(title="Main window")

window = Window(app, title="2nd window", visible=False)

modal_window = Window(app, title="modal window", visible=False)

def open_modal():
    modal_window.show(True)

def close_modal():
    modal_window.hide()

open_window_button = PushButton(app, text="Open window", command=window.show)
open_modal_button = PushButton(app, text="Open modal window", command=open_modal)

close_window_button = PushButton(window, text="Close", command=window.hide)

close_modal_button = PushButton(modal_window, text="Close", command=close_modal)

app.display()