0

我对 python 和编码很陌生,我目前正在尝试使用 guizero 来制作一些基本的仪表板。我的问题是:如何在 guizero 中更改应用程序的顶部菜单栏?这甚至可能吗?

先感谢您。

我的代码:

from guizero import App, PushButton, Text, Box

def dashboard():
# Dashboard settings
dashboard = App(title="Dashboard", width=320, height=320)
dashboard.bg = grey


# Title & title box
title_box = Box(dashboard, align="top", border=True)
title = Text(title_box, text="Dashboard", size=30)
title.text_color = orange

# Led status display
status_box = Box(dashboard, align="top", border=True)
status1 = Text(status_box, align="left", text="Status Led 1")
status1.bg = white
status1.size = 15

status_box1 = Box(dashboard, align="top", border=True)
status2 = Text(status_box1, text="Status Led 2")
status2.bg = white
status2.size = 15

status_box2 = Box(dashboard,align="top", border=True)
status3 = Text(status_box2, text="Status Led 3")
status3.bg = white
status3.size = 15

# Status Pushbuttons
status_pushbutton = Box(dashboard,align="bottom", border=True)
status_button = Text(status_pushbutton, text="Status Pushbutton 3")
status_button.bg = white
status_button.size = 15

status_pushbutton1 = Box(dashboard, align="bottom", border=True)
status_button1 = Text(status_pushbutton1, text="Status Pushbutton 2")
status_button1.bg = white
status_button1.size = 15

status_pushbutton2 = Box(dashboard, align="bottom", border=True)
status_button2 = Text(status_pushbutton2, text="Status Pushbutton 1")
status_button2.bg = white
status_button2.size = 15

dashboard.display()
4

1 回答 1

0

你甚至没有菜单栏,你是什么意思?Ps 你不应该把'dashboard = App'放在一个函数中。您也没有在颜色名称周围添加任何“”或“”。

于 2020-12-27T16:25:55.707 回答