stui

command module
v0.0.0-...-beda47f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2019 License: AGPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Stui

A language-agnostic GUI driver

Pass messages through stdio or 0mq sockets

echo '["PostElem", "#app", -1, ["button", "stdio is all you need!"]]
      ["Subscribe", "button", "onmousemove", ["x", "y"]]' | stui
# ["hi"]
# ["ui","button","onmousemove",{"x":78,"y":23}]
# ["ui","button","onmousemove",{"x":77,"y":23}]
# ["ui","button","onmousemove",{"x":76,"y":24}]
# ["bye"]

Why?

Typical GUI toolkits require language-native bindings. This limits the options available to smaller languages, and forces every application to tightly couple itself to both the toolkit and the particular binding used.

With stui, any language that can form and parse JSON can build a GUI.

stui is primarily a message scheme. This message scheme does not specify what element tags or attributes to use. This implementation, using the wonderful WebView, requires HTML tags and CSS selectors. Another driver could use a GtkHBox or QBoxLayout or Tk.Frame or wx.BoxSizer instead of a div, but keep the same message structure and semantics.

You can write your own - trivial - headless driver for testing your data model. Just feed your program a simple script of pre-fabricated events.

Performance?

Depends entirely on the widget toolkit. gtkwebview is much smaller than a Chromium Embedded Framework app, but I've noticed it struggles with dozens of simultaneous CSS transitions.

Stable?

Not quite yet. See the issues tagged Blocker. Mostly I want a second pair of eyes on the message scheme.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址