Skip to content

Ported from Plushie

Plushie is another Python library for native GUIs built on iced, which runs iced in a separate renderer process (how they compare). These are its demo apps, rewritten for yugui: put them side by side with the originals to see how the two APIs differ.

Async fetch

slow work on a background thread, with loading and errors. ui.perform runs the function on a thread of its own, so the window stays responsive, then sends then(result), or catch(exception) if it raised.

Source: examples/plushie/async_fetch.py

Async fetch

Catalog

the basic widgets, in four tabs.

Source: examples/plushie/catalog.py

Catalog

Clock

the time, updated every second, with a start/stop button.

Source: examples/plushie/clock.py

Clock

Color picker

a hue ring around a saturation and brightness square. Drag on the ring to choose a hue, drag in the square to choose saturation (across) and brightness (down). The arrow keys adjust what was last touched (Tab switches between the ring and the square), by bigger steps with Shift; Page Up/Down, Home and End work too.

Source: examples/plushie/color_picker.py

Color picker

Notes

a list of notes to search, select and delete, and an editor The list filters on the search text (title or body, ignoring case); the check boxes select notes for "Delete Selected". "Edit" opens a note: its title and body are edited with every change one undo step, and "Back" saves them into the list. Undo puts the body's cursor back at the start, since the text comes back from the model.

Source: examples/plushie/notes.py

Shortcuts

every key pressed, with its modifiers, in a scrolling log. Keys go to ui.on_key only when no widget takes them; this app has no text input, so it sees them all.

Source: examples/plushie/shortcuts.py

Shortcuts

Todo

add items, tick them off, filter them, delete them. Enter adds the item typed and keeps the focus in the input (a ui.focus task). Rows are keyed by item id, so ticking or deleting one leaves the others' widget state where it was.

Source: examples/plushie/todo.py

Todo