python - Python,Guizero:更改应用程序顶部菜单栏的颜色
问题描述
我对 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()
解决方案
你甚至没有菜单栏,你是什么意思?Ps 你不应该把'dashboard = App'放在一个函数中。您也没有在颜色名称周围添加任何“”或“”。
推荐阅读
- amazon-web-services - 使用 terraform cloud [aws-provider] 启动 ec2 实例时,既无法执行 user_data 脚本,也无法使用连接块执行 remote-exec
- azure - 在 Azure 中,通过 VPN 访问虚拟服务器。虚拟服务器必须禁止公共访问
- html - CSS - 选项卡样式,其中活动按钮是唯一没有下面一行的东西
- jt400 - AS400 (IBM i) 拒绝通过 JT400 IFSFILE 和 IFSFILEWRITER 类进行连接的尝试
- node.js - 将下拉值和对象 ID 绑定到功能和设置状态
- ruby-on-rails - Rails:按用户分组项目,然后计数状态
- python - 运行 python 脚本时内存不足
- python - Pandas:如何规范化具有多个 JSON 嵌套列表的 JSON 文件?
- spring-boot - Spring Boot 属性 spring.jpa.show-sql 不适用于 Datastore
- javascript - VuePress v.2.0.0-beta.26 使用 v-bind 时出错:可能需要额外的加载器