Skip to content

Commit

Permalink
Merge pull request #467 from lawsie/dev
Browse files Browse the repository at this point in the history
v1.4.0
  • Loading branch information
Martin O'Hanlon authored Feb 1, 2023
2 parents ef9124a + 9bbd558 commit f6c1951
Show file tree
Hide file tree
Showing 33 changed files with 337 additions and 215 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.3.0](changelog.md)
guizero is currently [version 1.4.0](changelog.md)

2 changes: 1 addition & 1 deletion docs-src/docs/book.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

The authors of guizero have written a book containing ten fun guizero projects. The book starts from a very basic GUI and shows you how to create gradually more complex GUI programs including a painting program and a stop-motion animation creator.

You can [buy the book in print](https://store.rpipress.cc/products/create-graphical-user-interfaces-with-python) or download it as a [free PDF](https://magpi.raspberrypi.org/books/create-guis).
You can download it as a [free PDF](https://magpi.raspberrypi.org/books/create-guis).

![guizero book](images/guizero-book.jpg)
4 changes: 2 additions & 2 deletions docs-src/docs/box.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ A `Box` object is invisible, but it can contain other widgets. In this example,
from guizero import App, Box, Text
app = App(title="My app", height=300, width=400)
box = Box(app)
text1 = Text(box, text="Hello from the box", size=14, text_color="red", font="Arial")
text2 = Text(app, text="Hello from the app", size=14, text_color="blue", font="Courier New")
text1 = Text(box, text="Hello from the box", size=14, color="red", font="Arial")
text2 = Text(app, text="Hello from the app", size=14, color="blue", font="Courier New")
app.display()
```

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

## 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
- 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/)
Expand Down
4 changes: 2 additions & 2 deletions docs-src/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ pip install pytest
To run all the automated tests:

```
cd guizero\test
cd guizero\tests
pytest -v
```

To run a specific test:

```
cd guizero\test
cd guizero\tests
pytest -v [test_filename.py]
```

Expand Down
1 change: 1 addition & 0 deletions docs-src/docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The event data returned has:
- `display_y` - the mouse's y position on the display when the event occurred
- `width` - the width of the widget.
- `height` - the height of the widget.
- `keycode` - the [keycode](https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/key-names.html) of the key which raised the event.

**Note:** only data relevant to the event will be returned. e.g. `key` is only returned for `when_key_#` events and `width` and `height` are only returned for `when_resized` events.

Expand Down
2 changes: 1 addition & 1 deletion docs-src/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ If you installed guizero using the easy install method, to upgrade you should fo
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.3.0.amd64.msi) or the [32-bit guizero installer](https://github.com/lawsie/guizero/releases/latest/download/guizero-1.3.0.win32.msi) depending on which version of Python you are using.
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`:
Expand Down
2 changes: 2 additions & 0 deletions docs-src/docs/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ 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 |
| enabled | boolean | `True` if the widget is enabled |
| end | int | The largest value selectable on the slider |
| 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 |
| height | [size](size.md) | Set the height of the widget in pixels or to `"fill"` |
| master | App or Box | The container to which this widget belongs |
| start | int | The smallest value selectable on the slider |
| text_size | int | The size of the text |
| text_color | [color](colors.md) | The colour of the text |
| tk | tkinter.Scale | The internal tkinter object, see [Using tkinter](usingtk.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ <h3 id="aims">Aims</h3>
<li>Generates helpful additional error messages</li>
</ul>
<h3 id="version">Version</h3>
<p>guizero is currently <a href="../changelog/">version 1.3.0</a></p></div>
<p>guizero is currently <a href="../changelog/">version 1.4.0</a></p></div>


</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/book/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
<h1 id="book">Book</h1>
<h3 id="create-graphical-user-interfaces-with-python">Create Graphical User Interfaces with Python</h3>
<p>The authors of guizero have written a book containing ten fun guizero projects. The book starts from a very basic GUI and shows you how to create gradually more complex GUI programs including a painting program and a stop-motion animation creator.</p>
<p>You can <a href="https://store.rpipress.cc/products/create-graphical-user-interfaces-with-python">buy the book in print</a> or download it as a <a href="https://magpi.raspberrypi.org/books/create-guis">free PDF</a>.</p>
<p>You can download it as a <a href="https://magpi.raspberrypi.org/books/create-guis">free PDF</a>.</p>
<p><img alt="guizero book" src="../images/guizero-book.jpg" /></p></div>


Expand Down
4 changes: 2 additions & 2 deletions docs/box/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ <h3 id="examples">Examples</h3>
<pre><code class="language-python">from guizero import App, Box, Text
app = App(title=&quot;My app&quot;, height=300, width=400)
box = Box(app)
text1 = Text(box, text=&quot;Hello from the box&quot;, size=14, text_color=&quot;red&quot;, font=&quot;Arial&quot;)
text2 = Text(app, text=&quot;Hello from the app&quot;, size=14, text_color=&quot;blue&quot;, font=&quot;Courier New&quot;)
text1 = Text(box, text=&quot;Hello from the box&quot;, size=14, color=&quot;red&quot;, font=&quot;Arial&quot;)
text2 = Text(app, text=&quot;Hello from the app&quot;, size=14, color=&quot;blue&quot;, font=&quot;Courier New&quot;)
app.display()
</code></pre>
<p><img alt="Box and app" src="../images/box-app.png" /></p>
Expand Down
11 changes: 11 additions & 0 deletions docs/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#guizero">guizero</a></li>
<li class="second-level"><a href="#140-2023-02-01">1.4.0 - 2023-02-01</a></li>

<li class="second-level"><a href="#130-2022-01-01">1.3.0 - 2022-01-01</a></li>

<li class="second-level"><a href="#120-2021-05-04">1.2.0 - 2021-05-04</a></li>
Expand Down Expand Up @@ -398,6 +400,15 @@
<div class="col-md-9" role="main">

<h1 id="guizero">guizero</h1>
<h2 id="140-2023-02-01">1.4.0 - 2023-02-01</h2>
<ul>
<li><a href="./slider/">Slider</a> start and end properties can now be at runtime</li>
<li><code>key_code</code> is now returned as part of <a href="./events/">events</a> meaning non-printing characters keys can now be detected</li>
<li>Resolved a bug with <a href="./waffle/">Waffle</a> whereby double events were triggered when the waffle was changed as part of the event handler</li>
<li>Removed use of deprecated Pillow.Image.ANTIALIAS constant </li>
<li>Various minor docs fixes</li>
<li>contributors <a href="https://github.com/martinohanlon">martinohanlon</a>, <a href="https://github.com/lawsie">lawsie</a></li>
</ul>
<h2 id="130-2022-01-01">1.3.0 - 2022-01-01</h2>
<ul>
<li>Added <a href="./titlebox/">TitleBox</a> widget</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/development/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,11 @@ <h2 id="tests">Tests</h2>
<pre><code>pip install pytest
</code></pre>
<p>To run all the automated tests:</p>
<pre><code>cd guizero\test
<pre><code>cd guizero\tests
pytest -v
</code></pre>
<p>To run a specific test:</p>
<pre><code>cd guizero\test
<pre><code>cd guizero\tests
pytest -v [test_filename.py]
</code></pre>
<p><em>Note - tkinter can error when running the tests usually when the interpreter doesn't start properly, it doesn't seem to like being initialised and destroyed hundreds of times, I suspect a file locking issue as you don't see the problem on Linux. So sometimes you might get a test fail with an error like <code>This probably means that tk wasn't installed properly.</code>. Just re-run the last failed errors! <code>pytest --lf -v</code></em></p>
Expand Down
1 change: 1 addition & 0 deletions docs/events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ <h3 id="event-data">Event Data</h3>
<li><code>display_y</code> - the mouse's y position on the display when the event occurred</li>
<li><code>width</code> - the width of the widget. </li>
<li><code>height</code> - the height of the widget.</li>
<li><code>keycode</code> - the <a href="https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/key-names.html">keycode</a> of the key which raised the event. </li>
</ul>
<p><strong>Note:</strong> only data relevant to the event will be returned. e.g. <code>key</code> is only returned for <code>when_key_#</code> events and <code>width</code> and <code>height</code> are only returned for <code>when_resized</code> events.</p>
<pre><code class="language-python">def clicked(event_data):
Expand Down
4 changes: 2 additions & 2 deletions docs/images/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,11 @@ <h2 id="images">Images</h2>
picture = Picture(app, image=&quot;test.gif&quot;)
app.display()
</code></pre>
<p>The types of image (GIF, JPG, PNG, etc) supported depend on how you <a href="..">installed guizero</a> and the setup of your computer.</p>
<p>The types of image (GIF, JPG, PNG, etc) supported depend on how you <a href="../">installed guizero</a> and the setup of your computer.</p>
<h3 id="supported-files-types">Supported files types</h3>
<p>All systems support the <code>GIF</code> file type.</p>
<p>Windows and Linux also support <code>PNG</code> files.</p>
<p>If you <a href="..#additional-features-install">installed the addition image features</a> using <code>pip</code> it will also have installed <code>PIL</code> (Python Imaging Library) and you will be able use the majority of commonly used image types.</p>
<p>If you <a href="../#additional-features-install">installed the addition image features</a> using <code>pip</code> it will also have installed <code>PIL</code> (Python Imaging Library) and you will be able use the majority of commonly used image types.</p>
<p>guizero will tell you what file types are supported on your computer using the following code:</p>
<pre><code class="language-python">from guizero import system_config
print(system_config.supported_image_types)
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ <h2 id="windows-msi-installer">Windows MSI installer</h2>
<p>If you are using Windows you can install guizero by downloading and running a Windows MSI installer application.</p>
<ol>
<li>
<p>Download either the <a href="https://github.com/lawsie/guizero/releases/latest/download/guizero-1.3.0.amd64.msi">64-bit guizero installer</a> or the <a href="https://github.com/lawsie/guizero/releases/latest/download/guizero-1.3.0.win32.msi">32-bit guizero installer</a> depending on which version of Python you are using.</p>
<p>Download either the <a href="https://github.com/lawsie/guizero/releases/latest/download/guizero-1.4.0.amd64.msi">64-bit guizero installer</a> or the <a href="https://github.com/lawsie/guizero/releases/latest/download/guizero-1.4.0.win32.msi">32-bit guizero installer</a> depending on which version of Python you are using.</p>
<p><strong>Note:</strong> If you are not sure what version of python you are running, run the following program in Python, which will output either <code>32</code> or <code>64</code>:</p>
<pre><code>import struct
print(struct.calcsize("P") * 8)
Expand Down Expand Up @@ -613,6 +613,6 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
</html>

<!--
MkDocs version : 1.1.2
Build Date UTC : 2022-03-25 14:07:56.303263+00:00
MkDocs version : 1.4.2
Build Date UTC : 2023-02-01 15:01:39.578447+00:00
-->
2 changes: 1 addition & 1 deletion docs/picture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ <h3 id="how-do-i-make-one">How do I make one?</h3>
<pre><code class="language-python">picture = Picture(app, image=&quot;images/test.gif&quot;)
</code></pre>
<h3 id="image-support">Image support</h3>
<p>Depending on your operating system and whether you installed the guizero <a href="..#additional-features-install">additional image features</a> will determine what <a href="../images/">image types you can use</a> with <code>Picture</code>.</p>
<p>Depending on your operating system and whether you installed the guizero <a href="../#additional-features-install">additional image features</a> will determine what <a href="../images/">image types you can use</a> with <code>Picture</code>.</p>
<p>By default GIF and PNG are supported, except macOS which only supports GIF.</p>
<h3 id="starting-parameters">Starting parameters</h3>
<p>When you create a <code>Picture</code> object you <strong>must</strong> specify <code>master</code> and you can specify any of the optional parameters. Specify parameters in the brackets, like this: <code>picture = Picture(app, image="test.gif")</code></p>
Expand Down
2 changes: 1 addition & 1 deletion docs/pushbutton/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ <h3 id="how-do-i-make-one">How do I make one?</h3>
button = PushButton(app, image=&quot;button.gif&quot;, command=do_nothing)
app.display()
</code></pre>
<p>Depending on your operating system and whether you installed the guizero <a href="..#additional-features-install">additional image features</a> will determine what <a href="../images/">image types you can use</a> for <code>PushButton</code>. By default GIF and PNG are supported, except macOS which only supports GIF.</p>
<p>Depending on your operating system and whether you installed the guizero <a href="../#additional-features-install">additional image features</a> will determine what <a href="../images/">image types you can use</a> for <code>PushButton</code>. By default GIF and PNG are supported, except macOS which only supports GIF.</p>
<h3 id="starting-parameters">Starting parameters</h3>
<p>When you create a <code>PushButton</code> object you <strong>must</strong> specify <code>master</code> and you can specify any of the optional parameters. Specify parameters in the brackets, like this: <code>button = PushButton(app)</code></p>
<table>
Expand Down
36 changes: 18 additions & 18 deletions docs/search/lunr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.8
* Copyright (C) 2019 Oliver Nightingale
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
* Copyright (C) 2020 Oliver Nightingale
* @license MIT
*/

Expand Down Expand Up @@ -54,10 +54,10 @@ var lunr = function (config) {
return builder.build()
}

lunr.version = "2.3.8"
lunr.version = "2.3.9"
/*!
* lunr.utils
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -177,7 +177,7 @@ lunr.FieldRef.prototype.toString = function () {
}
/*!
* lunr.Set
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -211,8 +211,8 @@ lunr.Set.complete = {
return other
},

union: function (other) {
return other
union: function () {
return this
},

contains: function () {
Expand Down Expand Up @@ -389,7 +389,7 @@ lunr.Token.prototype.clone = function (fn) {
}
/*!
* lunr.tokenizer
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -465,7 +465,7 @@ lunr.tokenizer = function (obj, metadata) {
lunr.tokenizer.separator = /[\s\-]+/
/*!
* lunr.Pipeline
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -732,7 +732,7 @@ lunr.Pipeline.prototype.toJSON = function () {
}
/*!
* lunr.Vector
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -929,7 +929,7 @@ lunr.Vector.prototype.toJSON = function () {
/* eslint-disable */
/*!
* lunr.stemmer
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
*/

Expand Down Expand Up @@ -1151,7 +1151,7 @@ lunr.stemmer = (function(){
lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer')
/*!
* lunr.stopWordFilter
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1316,7 +1316,7 @@ lunr.stopWordFilter = lunr.generateStopWordFilter([
lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter')
/*!
* lunr.trimmer
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand All @@ -1343,7 +1343,7 @@ lunr.trimmer = function (token) {
lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer')
/*!
* lunr.TokenSet
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1827,7 +1827,7 @@ lunr.TokenSet.Builder.prototype.minimize = function (downTo) {
}
/*!
* lunr.Index
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -1994,7 +1994,7 @@ lunr.Index.prototype.query = function (fn) {
*/
var clause = query.clauses[i],
terms = null,
clauseMatches = lunr.Set.complete
clauseMatches = lunr.Set.empty

if (clause.usePipeline) {
terms = this.pipeline.runString(clause.term, {
Expand Down Expand Up @@ -2319,7 +2319,7 @@ lunr.Index.load = function (serializedIndex) {
}
/*!
* lunr.Builder
* Copyright (C) 2019 Oliver Nightingale
* Copyright (C) 2020 Oliver Nightingale
*/

/**
Expand Down Expand Up @@ -3456,7 +3456,7 @@ lunr.QueryParser.parseBoost = function (parser) {
} else if (typeof exports === 'object') {
/**
* Node. Does not work with strict CommonJS, but
* only CommonJS-like enviroments that support module.exports,
* only CommonJS-like environments that support module.exports,
* like Node.
*/
module.exports = factory()
Expand Down
15 changes: 13 additions & 2 deletions docs/search/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ function joinUrl (base, path) {
return base + "/" + path;
}

function escapeHtml (value) {
return value.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}

function formatResult (location, title, summary) {
return '<article><h3><a href="' + joinUrl(base_url, location) + '">'+ title + '</a></h3><p>' + summary +'</p></article>';
return '<article><h3><a href="' + joinUrl(base_url, location) + '">'+ escapeHtml(title) + '</a></h3><p>' + escapeHtml(summary) +'</p></article>';
}

function displayResults (results) {
Expand All @@ -37,7 +44,11 @@ function displayResults (results) {
search_results.insertAdjacentHTML('beforeend', html);
}
} else {
search_results.insertAdjacentHTML('beforeend', "<p>No results found</p>");
var noResultsText = search_results.getAttribute('data-no-results-text');
if (!noResultsText) {
noResultsText = "No results found";
}
search_results.insertAdjacentHTML('beforeend', '<p>' + noResultsText + '</p>');
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit f6c1951

Please sign in to comment.