search
[last updated: 2025-10-27]
GUIzero parameter programming
GUIzero Widget programming
GUIzero - importing def files
Python: Programming
(link to:) Github: GUIzero Help
(link to:) lawsie - guizero reference
On This Page:
---------------------------------------------------------
-----
GUIzero creates a GUI (Graphical User Interface) by creating a page of widgets.
Widgets are objects, like windows, boxes, text fields, text input fields, pushbuttons, sliders, and bunches of other options.
You can customize size, color, position, borders, and other parameters of each of these widgets, to create the GUI you desire.
Actual install command, from terminal:
It is bundled with the current rPiOS, but if you need to install it manually...
(link to:) gpiozero docs
(link to:) install gpiozero
-----------------------------------------------------
This is a simple minimum. If you want to preserve ram, you might want to only import the specific guizero modules that you'll be using, eg:
I saw one forum note saying if you use tkinter, the import line must be first, ie. above/before the import guizereo line.
The "funcName" is the variable you assign to refer to the function.
As always in python, proper indentation is essential.
Program statements in a def must be indented 4 spaces.
The end of the def is signaled by a return to no indent
-------------
-----------------------------------------------------
This is the line that executes/renders your GUI creation onto your screen.
This starts an infinite update loop that continuously waits for (and responds to) events,
like mouse movements, clicks, or text typed into text boxes, etc.
-----------------------------------------------------
from guizero import App, Text
from tkinter import Label
a = App()
text_1 = Text(a, text="text 1")
label = Label(a.tk, text="label")
label.pack()
text_2 = Text(a, text="text 2")
a.display()
-----------------------------------------------------
Great tutorial: https://dev.to/jr_shittu/getting-started-with-graphical-user-interfaces-...
other good tips: https://lawsie.github.io/guizero/usingtk/
https://github.com/rdbende/Azure-ttk-theme
https://github.com/TomSchimansky/CustomTkinter
also research: tkbootstrap and PyQt
Installation: (link to:) lawsie.github
padding tips: https://stackoverflow.com/questions/71902553/how-can-i-set-this-gui-in-t...
About: https://lawsie.github.io/guizero/about/
Getting Started: https://lawsie.github.io/guizero/start/
alt instructions for install/start: https://pypi.org/project/guizero/
programming tips with links: https://pythonprogramming.altervista.org/gui-zero/
programming - commands: https://lawsie.github.io/guizero/commands/
programming - widgets: https://lawsie.github.io/guizero/widgetoverview/
programming - using widgets: https://lawsie.github.io/guizero/usingwidgets/
programming - events: https://lawsie.github.io/guizero/events/
boxes & layout https://lawsie.github.io/guizero/layout/#boxes
io project https://github.com/raspberrypilearning/the-all-seeing-pi/blob/master/wor...
https://lawsie.github.io/guizero/drawing/
https://newdevzone.com/posts/how-to-style-and-customize-tkinterguizero-m...
https://www.theamplituhedron.com/articles/How-to-develop-a-GUI-with-the-...
tkinter tutorial: https://riptutorial.com/tkinter/example/29714/place--
https://stackoverflow.com/questions/10133856/how-to-add-an-image-in-tkinter
https://stackoverflow.com/questions/45668895/tkinter-tclerror-image-does...
https://docs.python.org/3/library/tk.html
https://www.activestate.com/resources/quick-reads/how-to-add-images-in-t...
https://stackoverflow.com/questions/65461558/how-can-i-fix-an-image-erro...
https://stackoverflow.com/questions/72887613/how-do-i-add-guizero-widget...
scroll to Install Additional features: https://lawsie.github.io/guizero/
https://lawsie.github.io/guizero/events/
https://lawsie.github.io/guizero/resources/
using tkinter widgets https://lawsie.github.io/guizero/usingtk/
Not so good... https://www.futurelearn.com/info/courses/programming-with-guis/0/steps/6...
Tkinter for absolute positioning https://zetcode.com/tkinter/layout/
https://stackoverflow.com/questions/71631980/how-to-use-the-place-method...
YouTube - good: https://www.youtube.com/watch?v=p6Ipayo1e_0
Rev changelogs: https://lawsie.github.io/guizero/changelog/
option to guizero for simple GUI's https://forums.raspberrypi.com/viewtopic.php?t=219201
search for: Guizero hardware interface
-----
from:
https://github.com/lawsie/guizero/issues/434
from guizero import App, Text
from tkinter import Label, PhotoImage
app = App("I have a background image")
# Some raw tkinter to create the bg image
img = PhotoImage(file="bgimage.png")
label = Label(app.tk,image=img)
label.place(x=0, y=0)
# Text on top, but it will have a background
some_text = Text(app, "This is some text")
app.display()
----------------------------------------------------------------
from:
https://github.com/lawsie/guizero/issues/399
You can access the underlaying TK object and set its options, in this case the borderwidth (or bd) property
from guizero import App, PushButton
app = App("A picture button")
picture_button = PushButton(app, image="guizero.gif")
picture_button.tk.config(borderwidth = 0)
app.display()
----------------------------------------------------------------
im = Image.open(pathToImage)
ph = ImageTk.PhotoImage(im)
label = Label(window, image=ph)
label.image=ph #need to keep the reference of your image to avoid garbage collection
----------------------------------------------------------------
.
.
.
eof