Main Menu

search

You are here

GUIzero Parameter Programming

[last updated: 2025-11-15]
GUIzero home page
-----

  • For all widgets, the following cheat sheet will help you find correct code to specify a given parameter:

  • border
    • Box
      box01 = Box(mainW, border=3)
        Borders with relief:
        import tkinter as tk
        tmpBox.tk.config(borderwidth=4, relief="sunken") # or "raised" or others...
    • Text widgets don't have borders
      If you want a border around a text field, put the Text widget into a box, and the box can have a border property defined.
    • Pushbutton

  • text:
    • Box widgets don't have text property.
      If you want text in a box, create the box, then create a Text widget inside the box.
    • Text widget:
      tmpText = Text(mainW, ..., text="sometext")
      Changing it later:
      tmpText.value = "new text"


      Text font color:
      tmpText = Text(mainW, ..., text="sometext", color="red")
      Changing it later:
      tmpText.text_color = "white"


      Text font weight:
      Still struggling with this one. Best guess is that you must change the font declaration itself.
      But here's what I tried that did NOT work with my version...
          text01 = Text(parent, text="some text", font_weight="bold")
          text01 = Text(parent, text="some text", bold=True)
          text01.bold = True
          text01.font_weight = "bold"
          text01.font_weight = "strong"

    • Pushbutton

  • bg
    • Box
      tmpBox = Box([master], ...
    • Text
      tmpText = Text([master], ..., )
    • Pushbutton