Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0f60ce5
add set box borders example
martinohanlon Mar 22, 2024
ffaccc0
#492 Fixed in docs-src ONLY - please regen docs
lawsie May 1, 2024
4ec35a2
Add pyproject.toml #495
lawsie Jun 14, 2024
2572924
Docs style update
lawsie Jun 14, 2024
611d42e
Add `step` to Slider, + tests + docs (#511)
james-pcdr Jan 8, 2025
c77d073
Remove deprecated PIL method
lawsie Jan 8, 2025
cd69069
Update dev instructions and add requirements.txt
lawsie Jan 8, 2025
efb07eb
Add missing text properties to text derived widgets and containers (w…
Blindstars Jan 8, 2025
f01e9d9
Bump version
lawsie Jan 8, 2025
e834f89
Generate docs via mkdocs gh-deploy instead
lawsie Jan 8, 2025
ba4c42a
Change docs and add changelog
lawsie Jan 8, 2025
686d9b2
remove DS_Store files
martinohanlon Jan 9, 2025
439f7e9
Change version to 1.6.0
lawsie Jan 9, 2025
1e474f7
Change version no in pyproject.toml too
lawsie Jan 10, 2025
c1a527a
Edit changelog
lawsie Jan 10, 2025
fc30f57
Move mkdocs.yml into main folder so it can be deployed
lawsie Jan 10, 2025
68ad794
Fix broken image
lawsie Jan 10, 2025
acb1023
Make even with master (#519)
Mar 4, 2025
00c24ac
Fix broken docs
lawsie Mar 4, 2025
9152bd3
Merge branch 'master' into dev
Mar 4, 2025
85bd67b
Re-merge docs changes to dev (#521)
Mar 5, 2025
3765427
Fix TitleBox overstrike bug
lawsie Jul 7, 2026
b814960
Waffle Canvas y bug
lawsie Jul 7, 2026
61f107f
Bump pytest and fix test issue
lawsie Jul 7, 2026
f5cb9fc
Remove setup.py
lawsie Jul 7, 2026
25a107f
Bump to Python 3.6
lawsie Jul 7, 2026
6edc52e
Fix resize bug
lawsie Jul 7, 2026
1431943
Remove PushButton icon parameter
lawsie Jul 7, 2026
b2296c5
Merge branch 'fable-bugfixes' into dev
lawsie Jul 7, 2026
57287b3
Correct PushButton docstring for `command` parameter
TheGittyPerson Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# guizero

## Unreleased
- **Breaking:** removed the `icon` constructor argument from [PushButton](pushbutton.md), deprecated since 2018 in favour of `image` and non-functional (silently ignored) for several releases. Use `image` instead.

## 1.6.0 - 2025-01-10
- Add example for how to set box borders
- Add pyproject.toml to enable building with `build` module instead of `setup.py`
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install locally:

```
cd guizero
python setup.py install
pip install .
```

Build for deployment:
Expand Down
1 change: 0 additions & 1 deletion docs/pushbutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ __init__(
padx=10,
grid=None,
align=None,
icon=None,
visible=True,
enabled=None,
width=None,
Expand Down
9 changes: 1 addition & 8 deletions guizero/PushButton.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def __init__(
padx=10,
grid=None,
align=None,
icon=None,
visible=True,
enabled=None,
width=None,
Expand All @@ -27,7 +26,7 @@ def __init__(
The Container (App, Box, etc) the Picture will belong to.

:param Callable command:
A string containing the image to display, defaults to `None`.
The function to call when the button is pressed.

:param List args:
A list of arguments to pass to the command. Defaults to `None`.
Expand All @@ -53,11 +52,6 @@ def __init__(
:param string align:
How to align the widget within the grid, defaults to None.

:param string icon:
A string containing the image to display, defaults to `None`.
If an image is specified, this overrides any text set to display
on the button. (DEPRECATED)

:param bool visible:
If the widget should be visible, defaults to `True`.

Expand All @@ -75,7 +69,6 @@ def __init__(
"""

self._value = 0
self._image_source = icon
self._image_source = image
self._image = None
self._image_height = None
Expand Down
2 changes: 1 addition & 1 deletion guizero/Waffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def canvas_x(self):

@property
def canvas_y(self):
return self._canvas_x
return self._canvas_y

@property
def size(self):
Expand Down
4 changes: 2 additions & 2 deletions guizero/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _on_configure_change(self, event):
if self._actual_height != event.tk_event.height or self._actual_width != event.tk_event.width:

self._actual_height = event.tk_event.height
self._actual_width = event.tk_event.height
self._actual_width = event.tk_event.width

# call the resize event
if self._when_resized is not None:
Expand Down Expand Up @@ -945,5 +945,5 @@ def text_overstrike(self):

@text_overstrike.setter
def text_overstrike(self, overstrike):
TextMixin.set_text_underline(self, overstrike)
TextMixin.set_text_overstrike(self, overstrike)
super(ContainerWidget, self.__class__).text_overstrike.fset(self, overstrike)
6 changes: 1 addition & 5 deletions guizero/utilities.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# this is to cater for Python 2, is it really needed?
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
from inspect import getfullargspec

try:
from PIL import Image, ImageTk
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
]
description = "Python module to allow learners to easily create GUIs"
readme = "README.md"
requires-python = ">=3"
requires-python = ">=3.6"
keywords = ["GUI", "guizero", "interface",]
license = {text = "BSD-3-Clause"}
classifiers = [
Expand All @@ -23,7 +23,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand All @@ -39,4 +38,7 @@ images = ["pillow>=4.3.0"]

[project.urls]
Repository = "https://github.com/lawsie/guizero"
Documentation = "https://lawsie.github.io/guizero/"
Documentation = "https://lawsie.github.io/guizero/"

[tool.pytest.ini_options]
addopts = "--capture=sys"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ build==1.2.1
mkdocs==1.6.1
mkdocs-bootswatch==1.1
pre-commit==4.0.1
pytest==8.3.4
pytest==9.1.1
pillow>=4.3.0
87 changes: 0 additions & 87 deletions setup.py

This file was deleted.

22 changes: 5 additions & 17 deletions tests/common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from threading import Event
from time import sleep
from unittest.mock import MagicMock
from guizero import Text, Picture, TitleBox
from guizero import Text, Picture
from tkinter import Spinbox

# find a suitable font to test with
Expand Down Expand Up @@ -337,10 +337,7 @@ def cascading_properties_test(container):
container.text_underline = True
container.font = TEST_FONT
container.enabled = False

# Titleboxes cannot be overstruck, it underlines...
if not isinstance(container, TitleBox):
container.text_overstrike = True
container.text_overstrike = True

assert t.bg == "red"
assert t.text_color == "purple"
Expand All @@ -350,10 +347,7 @@ def cascading_properties_test(container):
assert t.text_underline == True
assert t.font == TEST_FONT
assert t.enabled == False

# Titleboxes cannot be overstruck, it underlines...
if not isinstance(container, TitleBox):
assert t.text_overstrike == True
assert t.text_overstrike == True

assert p.bg == "red"
assert p.enabled == False
Expand All @@ -372,10 +366,7 @@ def inheriting_properties_test(container):
container.text_underline = True
container.font = TEST_FONT
container.enabled = False

# Titleboxes cannot be overstruck, it underlines...
if not isinstance(container, TitleBox):
container.text_overstrike = True
container.text_overstrike = True

t = Text(container, color=None, size=None, font=None, bold=None, italic=None, underline=None, overstrike=None)
assert t.bg == "red"
Expand All @@ -386,10 +377,7 @@ def inheriting_properties_test(container):
assert t.text_underline == True
assert t.font == TEST_FONT
assert not t.enabled

# Titleboxes cannot be overstruck, it underlines...
if not isinstance(container, TitleBox):
assert t.text_overstrike == True
assert t.text_overstrike == True

p = Picture(container)
assert p.bg == "red"
Expand Down
13 changes: 13 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ def callback_params(event):
a.resize(505, 506)
assert not resize_event.wait(0.1)

# resize so that only the width changes, and the new width equals
# the previous height - this catches a bug where the widget's
# actual width was mistakenly tracked using the configure event's
# height, which masked width-only changes like this one
a.when_resized = callback
a.resize(300, 200)
assert resize_event.wait(1)
resize_event.clear()

a.resize(200, 200)
assert resize_event.wait(1)
resize_event.clear()

a.destroy()

def test_cascading_properties():
Expand Down
13 changes: 13 additions & 0 deletions tests/test_waffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ def test_pixel_getters_setters():
assert pixel.color == w.color
assert pixel.dotty == w.dotty

# canvas_x/canvas_y are the top-left pixel position on the canvas,
# offset by column/row * (pixel size + padding), plus the initial pad
assert pixel.canvas_x == w.pad + (pixel.x * (w.pixel_size + w.pad))
assert pixel.canvas_y == w.pad + (pixel.y * (w.pixel_size + w.pad))

# a second pixel with x and y swapped relative to the first, to catch
# canvas_x/canvas_y being confused with one another
pixel2 = w[1,0]
assert pixel2.canvas_x == w.pad + (pixel2.x * (w.pixel_size + w.pad))
assert pixel2.canvas_y == w.pad + (pixel2.y * (w.pixel_size + w.pad))
assert pixel.canvas_x != pixel2.canvas_x
assert pixel.canvas_y != pixel2.canvas_y

pixel.color = "red"
assert pixel.color == "red"

Expand Down