Advertisement
zhongnaomi

night mode gui

Sep 11th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from guizero import App, Text, ButtonGroup, Combo, PushButton, TextBox, CheckBox
  2. app = App(title="Hero-o-matic",height=600, width=400)
  3. def night_or_day_mode():
  4.     if darkmode.value == 1:
  5.         app.bg = "black"
  6.         app.text_color = "white"
  7.     else:
  8.         app.bg = "white"
  9.         app.text_color = "black"
  10.        
  11.  
  12.    
  13. # Your GUI widgets go here  
  14. darkmode = CheckBox (app, text ="night mode", command = night_or_day_mode)
  15.  
  16. # Show the GUI on the screen, start listening to events.
  17. app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement