New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'text.after' information #30

Closed
bsimmo opened this Issue Jun 13, 2017 · 3 comments

Comments

Projects
3 participants
@bsimmo
Contributor

bsimmo commented Jun 13, 2017

Hello,
After help on the forum I was trying too wrap my head around how to have auto updating text boxs, I was kindly linked to the undocumented auto_update_example.py.

Now I can understand what is happening, if I can get my program re-written to this style will be another thing ;-)

the .after is undocumented , I've look through the docs and some code (to do with text) but cannot find how it's implemented.

anyway,
I'm guessing text.after(1000, update_label)
1000 is time in ms ?
update_label is the function call.

Are there any other options or things I should know.

I appreciate this may be beyond guizero's current released usage.

(Basically I'm trying to add a GUI information screen to the SenseHAT datalogging style program)
Although starting with just a GPS coordinate screen with Lang/Lot and Time for proof of concept.

@lawsie

This comment has been minimized.

Show comment
Hide comment
@lawsie

lawsie Jun 13, 2017

Owner

Yes that's how it works - after() schedules an event every x milliseconds which is processed by the event loop. If you want continuous updates, you'll need to schedule an event with after() inside the function you are calling, to call the function again.

The after() functionality is used directly from tkinter - I haven't implemented anything different so it works in exactly the way tkinter does. I haven't got around to adding it to the docs yet but it is extremely useful.

Owner

lawsie commented Jun 13, 2017

Yes that's how it works - after() schedules an event every x milliseconds which is processed by the event loop. If you want continuous updates, you'll need to schedule an event with after() inside the function you are calling, to call the function again.

The after() functionality is used directly from tkinter - I haven't implemented anything different so it works in exactly the way tkinter does. I haven't got around to adding it to the docs yet but it is extremely useful.

@bsimmo

This comment has been minimized.

Show comment
Hide comment
@bsimmo

bsimmo Jun 13, 2017

Contributor

I'm coming at this as someone who has never used tkinter and anything on the Pi/linux has been text based programming.
I'm off to have a go.

Contributor

bsimmo commented Jun 13, 2017

I'm coming at this as someone who has never used tkinter and anything on the Pi/linux has been text based programming.
I'm off to have a go.

lawsie added a commit that referenced this issue Dec 13, 2017

Partial docs-src update
Closes #30 #36
Updated widgets up to and including ButtonGroup
Still needs work in using guizero section
@martinohanlon

This comment has been minimized.

Show comment
Hide comment
@martinohanlon

martinohanlon Dec 17, 2017

Collaborator

Closing, this is included in the v0.4 docs

Collaborator

martinohanlon commented Dec 17, 2017

Closing, this is included in the v0.4 docs

lawsie added a commit that referenced this issue Dec 19, 2017

Version 0.4 (#81)
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment