~eliasnaur/gio

Gio news, November 2019: X11, FreeBSD, Widgets & Themes, Sponsors

Details
Message ID
<BY8SBB0RKDHU.1X0F4L2DGUBMB@toolbox>
DKIM signature
pass
Download raw message
	
	X11 support

One of the most requested features, support for the X11 window
system, is now implemented in Gio. Denis Smirnov wrote the initial
patch and Denis Bernard completed it.

By default, both the X11 and Wayland backends are included when you
build Gio programs for Linux or FreeBSD, with the Wayland backend
taking precedence.

You can use the tags `-nox11` and `-nowayland` to exclude one of the
backends. Leaving out Wayland support is particularly useful to work
around gioui.org/issue/29, missing Wayland client side decorations.

	FreeBSD support

It was surprisingly easy to extend the Linux support to include
FreeBSD as well. Thanks to Denis Bernard for installing FreeBSD to
verify that it runs as expected.

	Automatic testing

Speaking of FreeBSD, Gio now uses the builds.sr.ht infrastructure to
build and test at each commit:

	https://builds.sr.ht/~eliasnaur/gio

Daniel Martí added end-to-end tests to ensure that low level input and
drawing works on the X11, Wayland and WebAssembly backends.

	Widgets and themes

The packages gioui.org/widget and gioui.org/widget/material implement
common widgets in the material design. Before, a Gio program had to
manage and draw widgets itself with only minimal assistance from the
text package (Label, Editor). Using a common widget set, programs are
now simpler and shorter. See the ioui.org/example/kitchen example that
demonstrates the entire widget library.

Package widget handles state tracking and event handling, while
package material implements drawing. Example:

	var gtx *layout.Context
	th := material.NewTheme()
	btn := new(widget.Button)

	// Handle events.
	for btn.Clicked(gtx) {
		...
	}

	// Draw button in the default style.
	th.Button("Click me!").Layout(gtx, btn)

See https://godoc.org/gioui.org/widget/material for other widgets and
customization options.

The initial release of the packages included Editor, Button and
IconButton; Alexander Arin since implemented CheckBox and
RadioButton.

	Layout format strings

As an experiment to shorten layout code even more, the
`eliasnaur.com/giox/layout` package implements a Format function,
which is like `fmt.Printf` for layouts. See

	https://lists.sr.ht/~eliasnaur/gio/%3CBXR2KXYJKQVO.1E27NGCB50H3P%40toolbox%3E

for an example (note that the package since moved from the Gio
standard library to eliasnaur.com/giox). The
https://godoc.org/eliasnaur.com/giox/layout package documentation
includes a description of the format language.

	Web-based git send-email workflow

git.sr.ht recently added support for sending patches from the web
frontend. If you work on a fork of Gio hosted on git.sr.ht, you can
prepare and send a patchset from

	https://git.sr.ht/~username/gio/send-email

(where ~username is your sr.ht username)

Send patches to the mailing list address, ~eliasnaur/gio@lists.sr.ht.

	Website and documentation

The gioui.org website no longer redirects to git.sr.ht. The frontpage
as well as the sourcehut wiki is now hosted directly on the domain
with a Go-inspired design. More documentation will be added to
gioui.org in the near future.

	Android

Gregory Pomerantz added several useful features for Android to the
`gogio` tool. A Gio program can now include custom .jar files, and
permissions can be specified by including one or more of the
`gioui.org/app/permission` packages. Gregory is working on a Bluetooth
LE heart rate monitor:

	https://git.wow.st/gmp/hrm

	Sponsors

Development on Gio relies 100% on sponsorships and donations, and I'm
very pleased to introduce the very first sponsor, Emmanuel Odeke and
his company Orijtech, Inc:

	https://orijtech.com

Orijtech works on observability and high performance systems, and if
you're looking for an interesting Go job, Orijtech is hiring. I've
worked with Emmanuel Odeke over the years on the Go mailing lists, and
met him at Gophercon San Diego this summer. He has been an absolute
pleasure to work with.

The first individual sponsor is Tanguy Herrmann. I met him at GoLab
2017 where I presented a way to access the Android Java API similar to
how Cgo allows access to C APIs. At my presentation, Tanguy asked me
an interestion question: why bother with writing Java in Go, and not
just write Java? I didn't have a good answer at the time, but
questions such as his motivated the idea of creating a truly
cross-platform GUI library.

If you also find the Gio project useful, please consider sponsoring my
full-time open source work on GitHub Sponsors:

	https://github.com/sponsors/eliasnaur

-- elias