ref: 112655e32697e0e4efdd57e100 gio-example/7gui/README.md -rw-r--r-- 1.2 KiB
112655e3Chris Waldon livedit: improve visual quality of demo 4 months ago

#7 GUIs

This demonstrates several classic GUI problems based on 7GUIs. They show different ways of using Gio framework.

The examples show one way of implementing of things, of course, there are many more.

The examples are over-commented to help understand the structure better, in practice, you don't need that many comments.


Counter shows basic usage of Gio and how to write interactions.

It displays a count value that increases when you press a button.


#Temperature Converter

Temperature conversion shows bidirectional data flow between two editable fields.

It implements a bordered field that can be used to propagate values back to another field without causing update loops.



Timer shows how to react to external signals.

It implements a timer that is running in a separate goroutine and the UI interacts with it. The same effect can be implemented in shorter ways without goroutines, however it nicely demonstrates how you would interact with information that comes in asynchronously.

The UI shows a slider to change the duration of the timer and there is a button to reset the counter.

UI, Timer