Skip to content

Commit

Permalink
Merge pull request #396 from lawsie/dev
Browse files Browse the repository at this point in the history
v1.1.1
  • Loading branch information
Martin O'Hanlon authored Nov 27, 2020
2 parents 626789d + a32aa52 commit c654db6
Show file tree
Hide file tree
Showing 90 changed files with 842 additions and 461 deletions.
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.1.0](changelog.md)
guizero is currently [version 1.1.1](changelog.md)

6 changes: 2 additions & 4 deletions docs-src/docs/app.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# App

(Contains a `tkinter.Tk` object)

```python
__init__(
self,
Expand Down Expand Up @@ -80,7 +78,7 @@ You can set and get the following properties:
| Method | Data type | Description |
|-------------|--------------------|--------------------------------------------------------------------------------------------|
| bg | [color](colors.md) | The background colour of the window |
| children | list(widgets) | A list of widgets in this container |
| children | List | A list of widgets in this container |
| enabled | boolean | `True` if the app is enabled |
| height | int | The height of the window |
| font | string | The font that widgets should use |
Expand All @@ -89,11 +87,11 @@ You can set and get the following properties:
| title | string | The title of the window |
| text_size | int | The size of the text widgets should use |
| text_color | [color](colors.md) | The colour of the text widgets should use |
| tk | tkinter.Tk | The internal tkinter object, see [Using tkinter](usingtk.md) |
| visible | boolean | If the app is visible |
| width | int | The width of the window |
| when_closed | function | The function to call when the `App` is closed. Setting to `None` (the default) will reset. |


Refer to a property as `<name of widget>.property`. For example, if your `App` object is called `app` you would write `app.title`.

You can **set** the property (for example `app.title = "Hello world"`) or **get** the value of the property to use (for example `print(app.title)`).
Expand Down
5 changes: 2 additions & 3 deletions docs-src/docs/box.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Box

(Contains a `tkinter.Frame` object)

```python
__init__(
self,
Expand Down Expand Up @@ -78,7 +76,7 @@ You can set and get the following properties:
| align | string | The alignment of this widget within its container |
| border | int | The border thickness, setting to `0` or `False` (the default) there is no border. |
| bg | [color](colors.md) | The background colour of the widget |
| children | list(widgets) | A list of widgets in this container |
| children | List | A list of widgets in this container |
| enabled | boolean | `True` if the box is enabled |
| grid | List | `[x,y]` coordinates of this widget. This parameter is only required if the `master` object has a grid |
| font | string | The font that widgets should use |
Expand All @@ -87,6 +85,7 @@ You can set and get the following properties:
| master | App | The `App` object to which this box belongs |
| text_size | int | The size of the text widgets should use |
| text_color | [color](colors.md) | The colour of the text widgets should use |
| tk | tkinter.Frame | The internal tkinter object, see [Using tkinter](usingtk.md) |
| visible | boolean | If this widget is visible |
| width | [size](size.md) | Set the width of the widget in pixels or to `"fill"` |

Expand Down
56 changes: 36 additions & 20 deletions docs-src/docs/buttongroup.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# ButtonGroup

(Contains a `tkinter.Frame` object)

```python
__init__(
self,
Expand Down Expand Up @@ -59,23 +57,23 @@ When you create a `ButtonGroup` object you **must** specify a `master` and you c

You can call the following methods on an `ButtonGroup` object.

| Method | Takes | Returns | Description |
|-------------------------------------|--------------------------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| append(option) | item (string) | - | Appends a new `option` to the end of the ButtonGroup. |
| after(time, command, args=None) | time (int), command (function name), args (list of arguments) | - | Schedules a **single** call to `command` after `time` milliseconds. (To repeatedly call the same command, use `repeat()`) |
| 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 |
| get_group_as_list() | - | list | Returns a list containing all of the text/hidden value pairs from the ButtonGroup (useful for debugging) |
| hide() | - | - | Hides the widget from view. This method will unpack the widget from the layout manager. |
| insert(index, option) | index (int), option (string) | - | Insert a new `option` in the ButtonGroup at `index` |
| remove(option) | item (string) | Boolean | Removes the first `option` from the ButtonGroup. Returns `True` if an item was removed. |
| repeat(time, command, args=None) | time (int), command (function name), args (list of arguments) | - | 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. |
| resize(width, height) | width (int), height (int) | - | Sets the width and height of the widget |
| show() | - | - | Displays the widget if it was previously hidden |
| update_command(command, args =None) | command (function name), args (_Optional_ List of arguments to be passed to command) | - | Updates the function to call when the selected option changes |
| Method | Takes | Returns | Description |
|-------------------------------------|--------------------------------------------------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| append(option) | item (string) | - | Appends a new `option` to the end of the ButtonGroup. |
| after(time, command, args=None) | time (int), command (function name), args (list of arguments) | - | Schedules a **single** call to `command` after `time` milliseconds. (To repeatedly call the same command, use `repeat()`) |
| 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 |
| get_group_as_list() | - | list | Returns a list containing all of the text/hidden value pairs from the ButtonGroup (useful for debugging) |
| hide() | - | - | Hides the widget from view. This method will unpack the widget from the layout manager. |
| insert(index, option) | index (int), option (string) | - | Insert a new `option` in the ButtonGroup at `index` |
| remove(option) | item (string) | Boolean | Removes the first `option` from the ButtonGroup. Returns `True` if an item was removed. |
| repeat(time, command, args=None) | time (int), command (function name), args (list of arguments) | - | 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. |
| resize(width, height) | width (int), height (int) | - | Sets the width and height of the widget |
| show() | - | - | Displays the widget if it was previously hidden |
| update_command(command, args =None) | command (function name), args (_Optional_ List of arguments to be passed to command) | - | Updates the function to call when the selected option changes |


### Properties
Expand All @@ -86,6 +84,7 @@ You can set and get the following properties:
|------------|--------------------|-------------------------------------------------------------------------------------------------------|
| align | string | The alignment of this widget within its container |
| bg | [color](colors.md) | The background colour of the widget |
| children | List | A list of the widgets in this container. `[RadioButton, *]` |
| enabled | boolean | `True` if the widget is enabled |
| font | string | The font of the text |
| grid | List | `[x,y]` coordinates of this widget. This parameter is only required if the `master` object has a grid |
Expand All @@ -97,7 +96,7 @@ You can set and get the following properties:
| width | [size](size.md) | Set the width of the widget in characters or to `"fill"` |
| text_size | int | The size of the text |
| text_color | [color](colors.md) | The colour of the text |

| tk | tkinter.Frame | The internal tkinter object, see [Using tkinter](usingtk.md) |

Refer to a property as `<name of widget>.property`. For example, if your `ButtonGroup` object is called `choice` you would write `choice.value`.

Expand Down Expand Up @@ -126,3 +125,20 @@ activities = ButtonGroup(app, options=[
what_is_selected = Text(app, text="skate")
app.display()
```

### Using ButtonGroup tk widgets

Advanced users can gain internal access to the internal tkinter widgets used by `ButtonGroup`. For more information on using tkinter in combination with guizero see [Using tkinter](usingtk.md).

The `ButtonGroup` widget contains a `tkinter.Frame` object, which frames multiple guizero `RadioButton` widgets. Each `RadioButton` widget contains a `tkinter.Radiobutton` object.

The `.children` property returns the list of `RadioButton` widgets in the order they appear in the `ButtonGroup`:

To access the internal `RadioButton` tk object you would use the child's `tk` property e.g.

```python
button_group = ButtonGroup(app)

for radio_button in ButtonGroup.children:
tk_radio_button = radio_button.tk
```
9 changes: 9 additions & 0 deletions docs-src/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# guizero

## 1.1.1 - 2020-11-27
- PushButton image bug fix for macOS
- Documentation updates regarding how to use tk, particularly for ListBox widget
- Refactored `.description` property due to issue with TextBox widget
- Fix TextBox widget where you cant set the value if its disabled
- Removed `bgcolor` from App constructor which had previously been deprecated
- Resolved issue with `Waffle` and being able to click "outside" the waffle
- contributors [martinohanlon](https://github.com/martinohanlon), [aajshaw](https://github.com/aajshaw)

## 1.1.0 - 2019-10-25
- Added ability to be able to change the grid of a widget at room time
- Added `hide_text` to `TextBox` for use with passwords
Expand Down
Loading

0 comments on commit c654db6

Please sign in to comment.