Textual (Python GUI Library)

Created on 2024-02-15T22:58:04-06:00

Return to the Index

This card pertains to a resource available on the internet.

This card can also be read via Gemini.

Used this to create a little interface for quickly classifying tasks as "jinky" or "not jinky." It was very easy and quick to get working and I did not regret. Would be nice to have access to a library like this in Nin actually.

App

Top level widget

Declares key bindings for the user

Actions

Procedures which begin with "action_"

Can be declared by BINDINGS in the application class

Attaching controls to containers

Compose function: Yields the components that will be used by a view

`mount` and `unmount` functions allow control management at runtime

Event propagation

Events involve calling functions like "on_button_pressed" on the container for a widget; you must then check the ID of the widget to determine what it should do.

UI updates

`update` functions are used to tell a component to change its text and schedule some re-drawing