Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
Go to file
Pietro Gagliardi 31f2b6d059 More future plans. 2016-06-12 11:55:26 -04:00
_wip Added uiGrid on OS X. Now to fix build errors. 2016-06-11 23:09:53 -04:00
common Implemented uiGrid on GTK+. 2016-06-09 18:57:58 -04:00
darwin Added some rather fickle debugging. 2016-06-11 23:52:35 -04:00
doc Pinned down resource numbers now. 2016-06-04 14:36:55 -04:00
examples Updated the README and example screenshots. Here we go for real! 2016-06-05 18:00:18 -04:00
test Fixed a tester bug. 2016-06-11 23:53:49 -04:00
unix Implemented uiGrid on GTK+. 2016-06-09 18:57:58 -04:00
windows Fixed a memory leak in Windows uiForm. NOW OS X. 2016-06-10 22:29:20 -04:00
.travis.yml string(APPEND) is too recent for travis's cmake (or 2.8.11, for that matter). 2016-06-05 13:48:51 -04:00
ANNOUNCE.md Split old announcements and updates out. 2016-06-09 11:22:02 -04:00
CMakeLists.txt Added Windows uiGrid. Doesn't quite work yet. 2016-06-10 19:34:48 -04:00
Changelog.md Split old announcements and updates out. 2016-06-09 11:22:02 -04:00
Compatibility.md More future plans. 2016-06-12 11:55:26 -04:00
LICENSE Split into a new repository and added a LICENSE. 2015-04-16 20:31:11 -04:00
README.md Merge pull request #115 from ghaberek/master 2016-06-09 11:25:16 -04:00
TODO.md More TODOs. 2016-06-08 23:52:53 -04:00
oldhaiku.tgz Discontinued the Haiku port for now. 2016-04-24 14:18:56 -04:00
ui.h Started uiGrid. 2016-06-09 17:15:59 -04:00
ui_darwin.h More TODOs. 2016-05-26 21:27:13 -04:00
ui_unix.h Implemented uiGrid on GTK+. 2016-06-09 18:57:58 -04:00
ui_windows.h Removed uiControlVerifyDestroy(); we could have just had it in uiFreeControl(). 2016-05-22 01:07:25 -04:00

README.md

libui: a portable GUI library for C

This README is being written.
Build Status (currently failing because the version of cmake that Travis uses treats Objective-C files as C++; if you know the fix please file a PR)

Announcements

  • 5 June 2016
    • Alpha 3.1 is here. This was a much-needed update to Alpha 3 that changes a few things:
      • The build system is now cmake. cmake 2.8.11 or higher is needed.
      • Static linking is now fully possible.
      • MinGW linking is back, but static only.

Old announcements can be found in the ANNOUNCE.md file.

Updates

Note that today's entry may be updated later today.

  • 8 June 2016

    • Added uiForm, a new container control that arranges controls vertically, with properly aligned labels on each. Have fun!
  • 6 June 2016

    • Added uiRadioButtonsSelected(), uiRadioButtonsSetSelected(), and uiRadioButtonsOnSelected() to control selection of a radio button and catch an event when such a thing happens.
  • 5 June 2016

    • Added uiNewPasswordEntry(), which creates a new uiEntry suitable for entering passwords.
    • Added uiNewSearchEntry(), which creates a new uiEntry suitable for searching. On some systems, the OnChanged() event will be slightly delayed and/or combined, to produce a more natural feel when searching.

Old updates can be found in the Changelog.md file.

Runtime Requirements

  • Windows: Windows Vista SP2 with Platform Update or newer
  • Unix: GTK+ 3.10 or newer
  • Mac OS X: OS X 10.8 or newer

Build Requirements

  • All platforms:
    • CMake 2.8.11 or newer
  • Windows: either
    • Microsoft Visual Studio 2013 or newer (2013 is needed for va_copy()) — you can build either a static or a shared library
    • MinGW-w64 (other flavors of MinGW may not work) — you can only build a static library; shared library support will be re-added once the following features come in:
      • Isolation awareness, which is how you get themed controls from a DLL without needing a manifest
  • Unix: nothing else specific
  • Mac OS X: nothing else specific, so long as you can build Cocoa programs

Building

Out-of-tree builds typical of cmake are preferred:

$ # you must be in the top-level libui directory, otherwise this won't work
$ mkdir build
$ cd build
$ cmake ..

Pass -DBUILD_SHARED_LIBS=OFF to cmake to build a static library. The standard cmake build configurations are provided; if none is specified, Debug is used.

If you use a makefile generator with cmake, then

$ make
$ make tester         # for the test program
$ make examples       # for examples

and pass VERBOSE=1 to see build commands. Build targets will be in the build/out folder.

Project file generators should work, but are untested by me.

On Windows, I use the Unix Makefiles generator and GNU make (built using the build_w32.bat script included in the source and run in the Visual Studio command line). In this state, if MinGW-w64 (either 32-bit or 64-bit) is not in your %PATH%, cmake will use MSVC by default; otherwise, cmake will use with whatever MinGW-w64 is in your path. set PATH=%PATH%;c:\msys2\mingw(32/64)\bin should be enough to temporarily change to a MinGW-w64 build for the current command line session only if you installed MinGW-w64 through MSYS2; no need to change global environment variables constantly.

Installation

Arch Linux

Can be built from AUR: https://aur.archlinux.org/packages/libui-git/

Documentation

Needs to be written. Consult ui.h and the examples for details for now.

Language Bindings

libui was originally written as part of my package ui for Go. Now that libui is separate, package ui has become a binding to libui. As such, package ui is the only official binding.

Other people have made bindings to other languages:

Language Bindings
C#/.net LibUI.Binding, SharpUI
Crystal libui.cr
D DerelictLibui
Euphoria libui-euphoria
Haskell libui-haskell
JavaScript libui.js (merged into libui-node?)
Julia Libui.jl
Lua libuilua, libui-lua
Nim ui
Node.js libui-node
Python pylibui
Ruby libui-ruby
Rust libui-rs

Screenshots

From examples/controlgallery:

Windows

Unix

OS X