ce2645a83c | ||
---|---|---|
test | ||
unmigrated | ||
.travis.yml | ||
LICENSE | ||
README.md | ||
bleh_darwin.m | ||
button.go | ||
callbacks_unix.go | ||
checkbox.go | ||
cocoalists | ||
combobox.go | ||
comctl_windows.go | ||
common_windows.go | ||
control.go | ||
controlcandidates.md | ||
controls_windows.go | ||
d32 | ||
delegate_darwin.go | ||
dialog.go | ||
dialog_darwin.go | ||
dialog_unix.go | ||
dialog_windows.go | ||
grid.go | ||
gtkcalls_unix.go | ||
gtkcasts_unix.go | ||
implementation.md | ||
init.go | ||
init_windows.go | ||
label.go | ||
layoutplan.md | ||
lineedit.go | ||
listbox.go | ||
listbox_darwin.go | ||
listbox_unix.go | ||
menus_windows.go | ||
objc_darwin.go | ||
objc_darwin.h | ||
plan.md | ||
prefsize_darwin.go | ||
prefsize_unix.go | ||
prefsize_windows.go | ||
progressbar.go | ||
restrictions.md | ||
stack.go | ||
stdfont_windows.go | ||
stdwndclass_windows.go | ||
sysdata.go | ||
sysdata_darwin.go | ||
sysdata_unix.go | ||
sysdata_windows.go | ||
test.sh | ||
todo.md | ||
uitask_darwin.go | ||
uitask_unix.go | ||
uitask_windows.go | ||
window.go | ||
windows_windows.go | ||
winerrors.md |
README.md
Native UI library for Go
THIS PACKAGE IS UNDER ACTIVE DEVELOPMENT. Feel free to start using it, but mind: it's far from feature-complete, it's still in need of testing and crash-fixing, and the API can (and will) change. If you can help, please do! Run ./test
to build a test binary test/test
which runs a (mostly) feature-complete UI test. Run ./d32 ./test
to build a 32-bit version (you will need a cgo-enabled 32-bit go environment, and I have only tested this on Mac OS X).
This is a simple library for building cross-platform GUI programs in Go. It targets Windows, Mac OS X, Linux, and other Unixes, and provides a thread-safe, channel-based API. The API itself is minimal; it aims to provide only what is necessary for GUI program design. That being said, suggestions are welcome. Layout is done using various layout managers, and some effort is taken to conform to the target platform's UI guidelines. Otherwise, the library uses native toolkits.
ui aims to run on all supported versions of supported platforms. To be more precise, the system requirements are:
- Windows: Windows 2000 or newer. The Windows backend uses package
syscall
and calls Windows DLLs directly, so does not rely on cgo. - Mac OS X: Mac OS X 10.6 (Snow Leopard) or newer. Objective-C dispatch is done by interfacing with libobjc directly, and thus this uses cgo.
- Note: you will need Go 1.3 or newer for this verison, as it uses a single .m file due to technical restrictions (read the comments in
bleh_darwin.m
for details), and earlier versions of Go do not auto-build .m files.
- Note: you will need Go 1.3 or newer for this verison, as it uses a single .m file due to technical restrictions (read the comments in
- Other Unixes: The Unix backend uses GTK+, and thus cgo. It requires GTK+ 3.4 or newer; for Ubuntu this means 12.04 LTS (Precise Pangolin) at minimum. Check your distribution.
ui itself has no outside Go package dependencies; it is entirely self-contained.
To install, simply go get
this package. On Mac OS X, make sure you have the Apple development headers. On other Unixes, make sure you have the GTK+ development files (for Ubuntu, libgtk-3-dev
is sufficient).
Package documentation is available at http://godoc.org/github.com/andlabs/ui.
For an example of how ui is used, see https://github.com/andlabs/wakeup, which is a small program that implements a basic alarm clock.
Contributing
Contributions are welcome. File issues, pull requests, approach me on IRC (pietro10 in #go-nuts; andlabs elsewhere), etc. Even suggestions are welcome: while I'm mainly drawing from my own GUI programming experience, everyone is different.
If you want to dive in, read implementation.md: this is a description of how the library works. (Feel free to suggest improvements to this as well.) The other .md files in this repository contain various development notes.
Please suggest documentation improvements as well.