File: menu_bar.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 (27 lines) | stat: -rw-r--r-- 532 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
24
25
26
27
from guizero import App, MenuBar

def file_open():
    print("Open")

def file_exit():
    print("Exit")
    app.destroy()

def edit_copy():
    print("Copy")

def edit_cut():
    print("Cut")

def edit_paste():
    print("Paste")

app = App()
menubar = MenuBar(app,
                  toplevel=["File", "Edit"],
                  options=[
                      [ ["Open", file_open], ["Exit", file_exit] ],
                      [ ["Copy", edit_copy], ["Cut", edit_cut], ["Paste", edit_paste] ]
                  ])

app.display()