Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from guizero import App, Box, PushButton, Text, TextBox, ButtonGroup, Slider
- app = App( height=600, width=800)
- """
- This GUI is split into 3 Box(es).
- - Header, Sidebar, and Content
- """
- #--------------
- boxHeader = Box(app, align="top", width="fill", height=150, border=1)
- boxHeader.bg="yellow"
- boxHeader.text_color="blue"
- # - add widgets to Box
- txtHeader_h2 = Text(boxHeader, text="Header", width="fill")
- txtHeader_h2.text_size = 24
- txtHeader_h2.bg="#000000"
- txtHeader_h2.text_color="white"
- """
- button01_2 = PushButton(boxHeader, text="Red")
- button01_2.bg="red"
- button01_2.text_color="white"
- """
- txtHeader_slider = Text(boxHeader, text="Change contrast")
- slider = Slider(boxHeader, width=400, height=20)
- slider.value = 50
- slider.bg = "#ff4a6e"
- slider.text_color = "#000000"
- slider.text_size = 14
- #---------------
- boxSidebar = Box(app, align="left", width=160, height="fill", border=1)
- boxSidebar.bg="#DDDDDD"
- boxSidebar.text_color="#000000"
- # - add widgets to Box
- txtSidebar_h2 = Text(boxSidebar, text="Sidebar", width="fill")
- txtSidebar_h2.text_size = 18
- txtSidebar_h2.bg="cyan"
- txtSidebar_h2.text_color="white"
- txtSidebar_sub1 = Text(boxSidebar, text="News type ..")
- txtSidebar_sub1.text_size = 14
- choice02_1 = ButtonGroup(boxSidebar, options=["World", "National", "Local"], selected="World")
- #---------------
- boxContent = Box(app, align="right", width="fill", height="fill", border=1)
- boxContent.bg="white"
- boxContent.text_color="#000000"
- # - add widgets to Box
- txtContent_h2 = Text(boxContent, text="Main Content", width="fill")
- txtContent_h2.text_size = 20
- txtContent_h2.bg="#000000"
- txtContent_h2.text_color="white"
- txtContent_h3 = Text(boxContent, text="Please enter your news ..", width="fill")
- txtContent_h3.text_size = 14
- txtContent_h3.bg="white"
- txtContent_h3.text_color="blue"
- txtContent_in = TextBox(boxContent, text="", multiline=True, height=8, width=90)
- txtContent_in.text_size = 14
- txtContent_in.bg="#CCCC00"
- txtContent_in.text_color="white"
- buttonSubmit = PushButton(boxContent, text="Submit story ..")
- buttonSubmit.bg="red"
- buttonSubmit.text_color="white"
- # -------
- txtContent_in.focus() # put text cursor in TextBox, ready for user input ..
- app.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement