Skip to content

Commit

Permalink
Merge pull request #493 from lawsie/dev
Browse files Browse the repository at this point in the history
v1.5.0
  • Loading branch information
martinohanlon authored Dec 3, 2023
2 parents 9e91b36 + cdbb367 commit 1020a23
Show file tree
Hide file tree
Showing 56 changed files with 539 additions and 495 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ app.display()

If you can download and unzip a file, you can [install guizero](https://lawsie.github.io/guizero/#easy-install) - **no special permissions or administrator rights are required**.

If you have administrator rights and are connected to the internet, you can use [pip to install guizero](https://lawsie.github.io/guizero/#install-using-pip).
If you have administrator rights and are connected to the internet, you can [use the command line to install or upgrade guizero](https://lawsie.github.io/guizero/#install-using-command-line).

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion docs-src/docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ The aim of guizero is to make the process of creating simple GUIs quick, accessi

### Version

guizero is currently [version 1.4.0](changelog.md)
guizero is currently [version 1.5.0](changelog.md)

2 changes: 1 addition & 1 deletion docs-src/docs/blocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app = App("Hello world")
app.display()
```

The line of code `app.display()` doesn't just display the app - it enters an **infinite event loop** which is watching and waiting for events to happen on the GUI. Events include things like the user clicking on a button, moving a slider, typing in a text box etc. No code written after this line will ever execute because the event loop is infinite.
The line of code `app.display()` doesn't just display the app - it enters an **infinite event loop** which is watching and waiting for events to happen on the GUI. Events include things like the user clicking on a button, moving a slider, typing in a text box etc. No code written after this line will execute until the application is closed.

### Example

Expand Down
25 changes: 17 additions & 8 deletions docs-src/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
# guizero

## 1.5.0 - 2023-12-03
- Uplifted to Python 3.12
- Resolve issue with Listbox / Combo / ButttonGroup where you couldnt programmatically update the widget unless it was enabled
- Documentation style change due to obsolete mkdocs theme
- Documentation fixes mainly dead links
- Updated installation guidance and instructions, to take into account changes to Raspberry Pi OS and Linux
- Removed Windows MSI installer as they have been depreciated
- contributors [martinohanlon](https://github.com/martinohanlon), [lawsie](https://github.com/lawsie)

## 1.4.0 - 2023-02-01
- [Slider](./slider/) start and end properties can now be at runtime
- `key_code` is now returned as part of [events](./events/) meaning non-printing characters keys can now be detected
- Resolved a bug with [Waffle](./waffle/) whereby double events were triggered when the waffle was changed as part of the event handler
- [Slider](slider.md) start and end properties can now be at runtime
- `key_code` is now returned as part of [events](events.md) meaning non-printing characters keys can now be detected
- Resolved a bug with [Waffle](waffle.md) whereby double events were triggered when the waffle was changed as part of the event handler
- Removed use of deprecated Pillow.Image.ANTIALIAS constant
- Various minor docs fixes
- contributors [martinohanlon](https://github.com/martinohanlon), [lawsie](https://github.com/lawsie)

## 1.3.0 - 2022-01-01
- Added [TitleBox](./titlebox/) widget
- Added cursor_position property to [TextBox](./textbox/)
- Made wrapping consistent (`word`) for multiline [TextBox](./textbox/) and added a `wrap` property
- Added [TitleBox](titlebox.md) widget
- Added cursor_position property to [TextBox](textbox.md)
- Made wrapping consistent (`word`) for multiline [TextBox](textbox.md) and added a `wrap` property
- Code tidy up
- Tested with Python 3.10 and added python version classifiers to setup.py
- Minor documentation updates
Expand Down Expand Up @@ -69,14 +78,14 @@
- contributors [martinohanlon](https://github.com/martinohanlon), [lawsie](https://github.com/lawsie)

## 0.6.2 - 2019-04-05
- Ability to [add tk widgets](./usingtk/) into a guizero app with `.add_tk_widget()`
- Ability to [add tk widgets](usingtk.md) into a guizero app with `.add_tk_widget()`
- ListBox scrollbar bug fix
- MenuBar background colour bug fix
- `setup.py` changes to allow dunders to be accessed from guizero module
- contributors [martinohanlon](https://github.com/martinohanlon), [lawsie](https://github.com/lawsie)

## 0.6.1 - 2019-03-08
- New [Drawing widget](./drawing/) for creating "drawings"
- New [Drawing widget](drawing.md) for creating "drawings"
- Added full screen support for `App` and `Window`
- Doc updates
- Minor bug fixes
Expand Down
4 changes: 0 additions & 4 deletions docs-src/docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Notes on how to deploy guizero (on Windows).

- Update version number in `guizero\__init__.py`
- Update version number in `docs-src\docs\about.md`
- Update version number for Windows MSI installer in `docs-src\docs\index.md`
- Update `changelog.md` in docs

## Python library
Expand All @@ -24,8 +23,6 @@ Build for deployment:
cd guizero
python setup.py sdist
python setup.py bdist_wheel
python setup.py bdist_msi --plat-name=amd64
python setup.py bdist_msi --plat-name=win32
```

Upload to pypi:
Expand Down Expand Up @@ -55,4 +52,3 @@ xcopy docs-src\site\* docs /E

- Push all changes to `master`.
- Create a new release on github named `0.0.0`.
- Upload Windows MSI installers named `guizero-0.0.0.amd64.msi` and `guizero-0.0.0.win32.msi` to the release.
4 changes: 2 additions & 2 deletions docs-src/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python -m pip install pip --upgrade
Install / upgrade pre-requisites:

```
pip install mkdocs mkdocs-bootswatch wheel twine virtualenv pytest pillow --upgrade
pip install mkdocs mkdocs-bootswatch wheel twine virtualenv pytest pillow setuptools --upgrade
```

## Python library
Expand Down Expand Up @@ -43,7 +43,7 @@ Checkout and install guizero for development:
git clone https://github.com/lawsie/guizero
cd guizero
git checkout dev
python setup.py develop
pip install -e .
```

When you have finished your development, deactivate your virtual environment:
Expand Down
4 changes: 2 additions & 2 deletions docs-src/docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The function which is called can also accept a parameter and will be passed data
The event data returned has:

- `widget` - the guizero widget which raised the event
- `tk_event` - the [tkinter event object](http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm)
- `tk_event` - the [tkinter event object](https://dafarry.github.io/tkinterbook/tkinter-events-and-bindings.htm)
- `key` - the key which raised the event
- `x` - the mouse's x position relative to the widget when the event occurred
- `y` - the mouse's y position relative to the widget when the event occurred
Expand Down Expand Up @@ -73,4 +73,4 @@ text_box.when_mouse_enters = highlight
text_box.when_mouse_leaves = lowlight

app.display()
```
```
Binary file added docs-src/docs/images/pi_apt_install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 29 additions & 60 deletions docs-src/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ guizero is designed to allow new learners to quickly and easily create GUIs for

If you can download and unzip a file, you can [install guizero](#easy-install) - **no special permissions or administrator rights are required**.

If you have administrator rights and are connected to the internet, you can use [pip to install or upgrade guizero](#install-using-pip) (recommended).

Windows users can also use the [Windows MSI installer](#windows-msi-installer).
If you have administrator rights and are connected to the internet, you can [use the command line to install or upgrade guizero](#install-using-command-line) (recommended).

## Easy install

Expand All @@ -30,9 +28,9 @@ Windows users can also use the [Windows MSI installer](#windows-msi-installer).

5. That's it! When you write your guizero code, make sure you save it into your home directory.

## Install using pip
## Install using command line

You can use the command prompt and `pip` to install guizero for:
You can use the command prompt to install guizero for:

+ [Windows](#windows)
+ [macOS](#macos)
Expand All @@ -47,7 +45,7 @@ You can use the command prompt and `pip` to install guizero for:

![windows command prompt](images/windows_command_prompt_app.png)

2. Type this command and press enter:
2. Type this command to use `pip` to install guizero and press enter:

```
pip3 install guizero
Expand All @@ -63,7 +61,7 @@ If you experience problems, have a look at this guide to [_Using pip on Windows_
![Mac terminal](images/mac-terminal.png)
2. Type this command and press enter:
2. Type this command to use `pip` to install guizero and press enter:
```
pip3 install guizero
Expand All @@ -77,13 +75,15 @@ If you experience problems, have a look at this guide to [_Using pip on Windows_
![pi terminal](images/pi-terminal.png)
2. Type this command and press enter:
2. Type this command to use `apt` to install guizero and press enter:
```
sudo pip3 install guizero
sudo apt-get install python3-guizero
```
![run pip install guizero](images/pi_pip_install.gif)
![run sudo apt-get install python3-guizero](images/pi_apt_install.gif)
**Note:** The installation available via apt may not be the latest. You can always install the latest version using `pip`.
### Linux
Expand All @@ -94,7 +94,7 @@ If you experience problems, have a look at this guide to [_Using pip on Windows_
![linux pip install](images/linux_pip_install.gif)
**Note:** If you are using Debian, you alternatively have the option to install guizero via apt
`sudo apt-get install python-guizero`
`sudo apt-get install python3-guizero`
### Install additional features
Expand All @@ -104,67 +104,36 @@ To use the additional [image features](images.md) of guizero such as:
- scaling images
- animated gifs
... you will need to install guizero with the pip command:
... you will need to install [PIL/pillow (python imaging library)](https://pypi.org/project/Pillow/).
- Windows / macOS
You can install pillow using `pip`:
```
pip3 install guizero[images]
```
```
pip3 install guizero[images]
```
- Linux / Raspberry Pi
Or using `apt` on Raspberry Pi / Linux
```
sudo pip3 install guizero[images]
```
```
sudo apt-get install python3-pillow
```
The additional image features are not available to install using the easy install method.
### Upgrading guizero
If you installed guizero using pip, you can upgrade guizero using a pip command:
Depending how you installed guizero will dictate how you should upgrade
- Windows / macOS
Using `pip`:
```
pip3 install guizero --upgrade
```
```
pip3 install guizero --upgrade
```
- Linux / Raspberry Pi
Using `apt`
```
sudo pip3 install guizero --upgrade
```
```
sudo apt-get install python3-guizero
```
If you installed guizero using the easy install method, to upgrade you should follow the same easy installation steps to download the latest version of guizero, then delete the old guizero folder and replace it with the newest version.
## Windows MSI installer
If you are using Windows you can install guizero by downloading and running a Windows MSI installer application.
1. Download either the [64-bit guizero installer](https://github.com/lawsie/guizero/releases/latest/download/guizero-1.4.0.amd64.msi) or the [32-bit guizero installer](https://github.com/lawsie/guizero/releases/latest/download/guizero-1.4.0.win32.msi) depending on which version of Python you are using.
**Note:** If you are not sure what version of python you are running, run the following program in Python, which will output either `32` or `64`:
import struct
print(struct.calcsize("P") * 8)
2. Run the guizero installer and select whether guizero should be installed ***for all users*** or ***just for me*** and click **Next**.
![windows msi installer step 1](images/windows_msi_1.png)
3. Select which version(s) of Python you want to install guizero for and click **Next**.
![windows msi installer step 2](images/windows_msi_2.png)
**Note:** For most people, there will be only one version of Python and you can safely choose the default option.
4. You may be asked *"Do you wish to allow this application from an unknown publisher to make changes to your device?"* - click **Yes**.
5. Wait while guizero is installed.
![windows msi installer step 3](images/windows_msi_3.png)
6. Click **Finish** when the installation is complete.
![windows msi installer step 4](images/windows_msi_4.png)
60 changes: 59 additions & 1 deletion docs-src/docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ pic = Picture(app, image="myimage.gif")
app.display()
```

## Button with an image

Create a picture `PushButton` with an image like this:

```python
from guizero import App, PushButton
def do_nothing():
print("A picture button was pressed")

app = App()
button = PushButton(app, image="button.gif", command=do_nothing)
app.display()
```

> The image `button.gif` should be stored in the folder as your program. Alternatively you can provide the path to your image.
## Toggle 2 buttons

Have 2 buttons, **start** and **stop** with them changing the `enabled` state of each other.
Expand Down Expand Up @@ -146,4 +162,46 @@ double_click_me = Text(app, text="Double click me")
double_click_me.when_double_clicked = double_click

app.display()
```
```

## Update your app using a timer

You can use `repeat` to periodically update your application. For example, a timer which updates every 1 second (1000 ms).

```python
from guizero import App, Text

# Update the counter
def counter():
text.value = int(text.value) + 1

app = App("Hello world")
text = Text(app, text="1")

# Schedule call to counter() every 1000ms
text.repeat(1000, counter)

app.display()
```

## Ask before closing the app

You can use a `yesno` box to check whether someone really wants to exit your app. If they click yes, the app is closed, if not, nothing happens and they can continue with what they were doing.

```python
from guizero import App, Text

# Ask the user if they really want to close the window
def do_this_when_closed():
if app.yesno("Close", "Do you want to quit?"):
app.destroy()

app = App()

title = Text(app, text="blank app")

# When the user tries to close the window, run the function do_this_when_closed()
app.when_closed = do_this_when_closed

app.display()
```
15 changes: 7 additions & 8 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/base.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/color-brewer.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/color-brewer.min.css">
<link href="/extra.css" rel="stylesheet">

<script src="/js/jquery-1.10.2.min.js" defer></script>
<script src="/js/bootstrap.min.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body>
Expand Down Expand Up @@ -227,12 +224,14 @@ <h1 id="404-page-not-found" style="text-align: center">404</h1>
<hr>
<p>Documentation built with <a href="https://www.mkdocs.org/">MkDocs</a>.</p>
</footer>
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script>
var base_url = "/",
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
</script>
<script src="/js/base.js" defer></script>
<script src="/search/main.js" defer></script>
<script src="/js/base.js"></script>
<script src="/search/main.js"></script>

<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
Expand Down
Loading

0 comments on commit 1020a23

Please sign in to comment.