Hi all!
Just upgraded ui-terminal-mojo to 26.2.0.dev2026012305.
I now have an macbook air M4 16Gb and it works there too.
It was working on linux too.
(Around 6MB ram and 0.3 cpu)
Feel free to enjoy this package, it is easy to create apps.
This cannot do “everything” (fixed width layouts),
but it can handle dynamic layouts like few.
Here is the new api tha makes this user-friendly:
Easy measurements API
For an small recap, there is no “call-back”, only an loop:
for _ in frames:
"Text" in ui # it knows size and where
if ui[-1].click(): # it knows if cursor there and if `enter pressed`
... # no callback, logic here
with MoveCursor.BelowThis(ui):
with MoveCursor.AfterThis[StyleBorderSimple](ui):
"left pannel" in ui
with MoveCursor.AfterThis[StyleBorderSimple](ui):
"right pannel" in ui
"multi line" in ui
Text("Footer") | Bg.green in ui
if ui[-1].click(): #Knows pos too here
...
"Thanks" in ui
if ui[-1].hover():
ui[-1] |= Fg.green
Thoses context managers also return values,
it is possible to check if the cursor is in any of thoses.
There is also an parameter for border color with default value.
My favourite feature is the toggleable tab menu:
it allows to toggle in and out an additional area on the left of the screen.
That area use the same apis, nothing special, and is an easy place for menus/nav.
This whole framework is pure posix (i’m not an expert),
no extra deps, only external_call.
What it’s not good for:
- Custom keys for events
ex: “if ui.keyboard_pressed(Key.a)”
Next on my todo-list
- States (with gc when unused)
ex:app.statemanager[Int]('SomeId')->ref
On the near todo list.
This is something users can do, but well done makes things easier. - Keeping fixed layout in % of screen
Require deep thinking. - Scrollable areas (An small view into an huge space)
Need 3. for this.
Over time, all and more will be done.
(the most difficult part is thinking how to do it “user friendly” way)
What it’s good for:
- User friendly (both for app user and programmer)
- Auto scale layouts (outer is always an result of inner)
- Very simple/small and easy to learn.
An typical app would be an “repo commits manager” interactive cli.
Or just an tool both an beginner or expert would like to be able to create.
And an link to previous thread (got closed after days of innactivity):
Previous thread