-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update readme * Make the Waffle clickable (#28) * Adding List GUI option * Adding clickability to the Waffle * Stashing new List widget * Add linux installation and make all subheadings h2 (#42) * Add updated versions of slider and text widgets * Fix bug with bgcolor and text_color * Add changes to ButtonGroup * Add changes to PushButton * Fixes #39 * Add changes for Picture * Add changes to TextBox * Add changes to CheckBox * Updates to CheckBox and Combo * Add changes to MenuBar and Waffle * Fix autopack, hide attributes, add changes to App and Box * Add changelog * Update changelog * Fixed waffle init bug courtesy of @jjsanderson * Rename size and add height and width * Add widget import * Create Widget.py (#57) * Waffle updated to update rather than redraw pixels (#61) * Update changelog.md * Update Widget.py (#62) Bug fix: `tk.grid_info` -> `self.tk.grid_info` * Update Widget.py (#68) * Fixed `tk.update` calls (#71) * Update Picture.py (testing) * Catch only `tk.TclError` instead of all exceptions * The `master` argument is required for testing. See https://stackoverflow.com/questions/23224574/tkinter-create-image-function-error-pyimage1-does-not-exist * Fixed `NameError` * Fix #69 wrong ButtonGroup layout * Update Picture.py * Partial docs-src update Closes #30 #36 Updated widgets up to and including ButtonGroup Still needs work in using guizero section * _Widget cancel fix * after/next *args fix * added editor detritus to gitignore * removed .vscode * updated after repeat * created tkmixins, updated App * Add more updated docs up to PushButton * refactored _Widget * Cleaned up * Replaced `type(master)` with `isinstance` check * Replaced `range(len(toplevel))` with `toplevel` (assuming it's iterable) * `i` → `menu` * Removed reference to _Widget * fixed MenuBar * added Waffle properties and examples * removed size mixin * removed waffle remember * updated Slider docs * updated Text docs * updated TextBox docs * updated Waffle docs * fixed examples * updated docs with the common methods * doc fixes * bump version to 0.4.0 * updated PushButton value * updated PushButton value * Need Waffle to still accept remember parameter For backwards compatibility * Add updated docs-src * Add generated HTML for new docs * Remove debug message in toggle function * Update mistake in pushbutton docs * Update changelog and readme * Update readme again * Add changelog link * Update changelog * Update ButtonGroup.py (#80) * `get_group_as_list` is now a one-liner * `StringVar` `master` is now the toplevel tkinter widget (required for testing) * fixed ButtonGroup * Add upgrade instructions * List upgrade instructions
- Loading branch information
Showing
110 changed files
with
7,535 additions
and
4,697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,79 @@ | ||
## gui zero | ||
# guizero | ||
|
||
Version 0.3.3 (7th June 2017) | ||
[Version 0.4](changelog.md) (19th December 2017) | ||
|
||
## Installing with pip | ||
guizero is designed to allow children to quickly and easily create GUIs for their programs. | ||
|
||
**Raspberry Pi / Linux** | ||
```bash | ||
sudo pip3 install guizero | ||
``` | ||
If you can download and unzip a file, you can use guizero - **no special permissions or administrator rights are required**. | ||
|
||
**Windows** | ||
```bash | ||
pip install guizero | ||
``` | ||
[Help, I don't know how to install something with pip](http://catcatcode.com/blog/installing-python-packages-with-pip/) | ||
guizero only requires `tkinter` to be installed, which is included with a standard Python installation on all platforms except Linux. | ||
|
||
**Upgrading** | ||
```bash | ||
sudo pip3 install -U guizero (on Raspberry Pi) | ||
pip install guizero --upgrade (on Windows) | ||
``` | ||
## Easy installation - all platforms | ||
|
||
# Mission statement | ||
Use this installation method if you do not have access to a terminal or command prompt on your computer. | ||
|
||
1. Click the green "Clone or download" button and then "Download ZIP" | ||
|
||
![Download the zip](images/download-zip.png) | ||
|
||
2. Unzip the file | ||
|
||
3. Open the `guizero-master` folder, then copy the `guizero` folder and paste it into your home directory | ||
|
||
![Copy the guizero folder](images/copy-guizero.png) | ||
|
||
4. That's it! When you write your guizero code, make sure you save it into your home directory. | ||
|
||
## Other installation methods | ||
|
||
If you have administrator rights to your computer and are connected to the internet, you can use pip to quickly install guizero. | ||
|
||
### Windows | ||
|
||
1. Make sure you have pip installed - follow [this guide](https://projects.raspberrypi.org/en/projects/using-pip-on-windows) if you are not sure. | ||
2. Open a command prompt | ||
3. Type `pip install guizero` and press Enter | ||
|
||
### Raspberry Pi | ||
|
||
1. Open a terminal window | ||
2. Type `sudo pip3 install guizero` and press Enter | ||
|
||
### On Mac | ||
1. Open a terminal (you can search for it in the Launch Pad) | ||
|
||
![Mac terminal](images/mac-terminal.png) | ||
|
||
2. Type `sudo pip3 install guizero` | ||
|
||
![Mac install screenshot](images/mac-install.png) | ||
|
||
### On Linux | ||
|
||
1. Open a terminal | ||
2. Install `tkinter` using your distribution's package manager, e.g. `sudo apt install python3-tk` | ||
3. Install guizero using pip by typing `sudo pip3 install guizero` | ||
|
||
## Upgrading | ||
|
||
- Raspberry Pi/Linux/Mac - `sudo pip3 install -U guizero` | ||
- Windows - `pip install guizero --upgrade` | ||
|
||
## Mission statement | ||
The aim of guizero is to make the process of creating simple GUIs quick, accessible and understandable for children. | ||
|
||
# Aims | ||
## Aims | ||
* Works with standard Python GUI library (and no need to install other libraries) | ||
* Abstracts away details children find hard (such as Tkinter StringVar() objects) | ||
* Accessible widget naming system to help children to build up a mental model | ||
* Flexible enough to be used for projects up to A-Level standard, yet accessible to primary school children | ||
* Comprehensive and accessible [documentation with examples](http://lawsie.github.io/guizero) | ||
* Helpful error messages | ||
|
||
# Documentation | ||
## Documentation | ||
|
||
[http://lawsie.github.io/guizero](http://lawsie.github.io/guizero) | ||
|
||
# Contributing | ||
## Contributing | ||
|
||
Contributions are welcome - please create a pull request for each fix/addition. The documentation for the latest release is in /docs as HTML files. Please edit the .md files inside /docs-src/docs folder to add documentation for a new feature. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# guizero 0.4 - What’s new? | ||
|
||
Thank you to everyone who has taken time to contribute code, suggest helpful improvements and report their use of the library. I am extremely grateful to the following people who have contributed pull requests since the last version: | ||
[bcroston](https://github.com/bcroston), [bennuttall](https://github.com/bennuttall), [Coal0](https://github.com/Coal0), [martinohanlon](https://github.com/martinohanlon) and [scotty3785](https://github.com/scotty3785) | ||
|
||
I am also very pleased to announce that [martinohanlon](https://github.com/martinohanlon) has very kindly agreed to maintain guizero whilst I am on maternity leave, beginning December 2017. | ||
|
||
## General changes | ||
|
||
- All classes rewritten with internal Tk objects rather than extending the Tk object, meaning you can access all Tk functionality as `Object.tk.tkmethod()` (Credit for idea: [bennuttall](https://github.com/bennuttall)) | ||
- Improved use of library with tab complete editors (e.g. ipython) – only the guizero properties and methods are listed so the list is shorter and more friendly. (Credit for idea: [bennuttall](https://github.com/bennuttall)) | ||
- [Bug fix] Grid layout now lays items out properly. Previously the x and y axes were flipped. (Whoops!) **This fix will cause apps with a grid layout to look different, but now behave correctly. You may need to update old code as a result of this change.** | ||
- All classes now inherit from mixins, adding 9 new common methods usable on most widgets - `after()`, `cancel()`, `destroy()`, `disable()`, `enable()`, `focus()`, `hide()`, `show()`, `repeat()`, (Credit: [Coal0](https://github.com/Coal0) and [martinohanlon](https://github.com/martinohanlon)) | ||
- The new `repeat()` method allows you to easily specify a repeated callback to a function, making it extremely easy to perform repetitive actions such as updating the GUI based on readings from a sensor. | ||
- Documentation and examples have been improved and updated | ||
|
||
## App | ||
- New constructor argument `bg` replaces deprecated `bgcolor` argument. If both are specified, `bg` overrides `bgcolor`. | ||
- `set_title()` and `bgcolor()` methods are now deprecated and have been replaced by `title` and `bg` properties | ||
- New additional properties `width` and `height` | ||
|
||
## ButtonGroup | ||
- `get()` and `set()` methods are now deprecated and have been replaced by the `value` property | ||
- New `value_text` property to get the text associated with the selected option | ||
|
||
## CheckBox | ||
- `get_text()`, `get_value()` and `change_text()` methods are now deprecated and have been replaced by the `value` and `text` properties | ||
- New `toggle()` method added | ||
|
||
## Combo | ||
- `get()` and `set()` methods are now deprecated and have been replaced by the `value` property | ||
- [Bug fix] `set_default()` now correctly resets the combo back to its originally specified value, whether this was the first option or a specified option | ||
|
||
## Picture | ||
- `set()` method is now deprecated and has been replaced by the `value` property | ||
|
||
## PushButton | ||
- `set_text()` method is now deprecated and has been replaced by the `text` property | ||
- New properties for `text_color`, `bg`, `font`, `text_size`, `height` and `width` – make your buttons look pretty! | ||
- Find out whether a button is pressed (1) or released (0) with the new `value` property | ||
- New `icon()` method to set the icon of a button after it is created | ||
- `toggle_state()` method deprecated and renamed to `toggle()` for consistency | ||
|
||
## Slider | ||
- New `value` property for getting and setting the value of the slider | ||
|
||
## Text | ||
- New constructor arguments `text_color` and `bg` | ||
- `color` constructor argument now deprecated and replaced by `text_color`. If both are specified, `text_color` overrides `color`. | ||
- `get()`, `set()`, `color()`, `font_face()` and `font_size()` methods are now deprecated, replaced by properties `value`, `text_color`, `bg`, `font` and `size` | ||
|
||
## TextBox | ||
- `get()` and `set()` methods now deprecated and replaced by `value` property | ||
|
||
## Waffle | ||
- All waffles will now have a memory. The `remember` constructor argument remains for backwards compatibility only **and will be removed in a future release**. | ||
- You can now click on a Waffle, and specify a command to run when the Waffle is clicked on. The function given as the command should take two arguments as it will be passed the x, y coordinates of the pixel that was clicked. (Credit: [scotty3785](https://github.com/scotty3785)) | ||
- Changed internal implementation of the Waffle so it should now be able to redraw more efficiently. (Credit: [scotty3785](https://github.com/scotty3785)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Common methods | ||
|
||
These methods can be called upon any guizero widget. | ||
|
||
| Method | Takes | Description | | ||
| ------------- | --------- | -------------------------- | | ||
| after(time, command) | time (int), command (function name) | Schedules a **single** call to `command` after `time` milliseconds. (To repeatedly call the same command, use `repeat()`) | | ||
| repeat(time, command) | time (int), command (function name) | Repeats `command` every `time` milliseconds. This is useful for scheduling a function to be regularly called, for example updating a value read from a sensor. | | ||
| cancel(command) | command (function name) | Cancels a scheduled call to `command` | | ||
| destroy() | - | Destroys the widget | | ||
| disable() | - | Disables the widget so that it is "greyed out" and cannot be interacted with | | ||
| enable() | - | Enables the widget | | ||
| focus() | - | Gives focus to the widget (e.g. focusing a `TextBox` so that the user can type inside it) | | ||
| hide() | - | Hides the widget from view. This method will unpack the widget from the layout manager. | | ||
| show() | - | Displays the widget | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.