libui-ng
A portable GUI library for C
|
It has come to my attention that I have not been particularly clear about how usable or feature-complete libui is, and that this has fooled many people into expecting more from libui right this moment than I have explicitly promised to make available. I apologize for not doing this sooner.
libui is currently mid-alpha software. Much of what is currently present runs stabily enough for the examples and perhaps some small programs to work, but the stability is still a work-in-progress, much of what is already there is not feature-complete, some of it will be buggy on certain platforms, and there's a lot of stuff missing. In short, here's a list of features that I would like to add to libui, but that aren't in yet:
In addition, here is a list of issues generalizing existing problems.
Furthermore, libui is not properly fully documented yet. This is mainly due to the fact that the API was initially unstable enough so as to result in rewriting documentation multiple times, in addition to me not being happy with really any existing C code documentation tool. That being said, I have started to pin down my ideal code documentation style in parts of ui.h
, most notably in the uiAttributedString APIs. Over time, I plan on extending this to the rest of the headers. You can also use the documentation for libui's Go bindings as a reference, though it is somewhat stale and not optimally written.
But libui is not dead; I am working on it whenever I can, and I hope to get it to a point of real quality soon!
Note that today's entry (Eastern Time) may be updated later today.
uiImageAppend()
not working as documented. It now works properly, with one important difference you'll need to care about: it now requires image data to be alpha-premultiplied. In addition, uiImage
also is implemented slightly more nicely now, and ui.h
has minor documentation typo fixes.uiImage
, and a new control, uiTable
, for displaying tabular data. These provide enough basic functionality for now, but will be improved over time. You can read the documentation for the new features as they are here. Thanks to everyone who helped get to this point, in particular @bcampbell for the initial Windows code, and to everyone else for their patience!uiDateTimePickerTime()
, uiDateTimePickerSetTime()
, and uiDateTimePickerOnChanged()
. These operate on standard <time.h>
struct tm
s. Thanks @cody271!libui.res
file with static builds. You do need to link in the appropriate manifest file, such as the one in the windows/
folder (I still need to figure out exactly what is needed apart from the Common Controls v6 dependency, or at least to create a complete-ish template), or at least include it alongside your executables. This also means you should no longer see random cmake errors when building the static libraries.uiTimer()
function for running code on a timer on the main thread. (Thanks to @cody271.)common/
directory to use uipriv
prefixes for everything that isn't static
. This is the first step toward fixing static library oddities within libui, allowing libui to truly be safely used as either a static library or a shared library.drawtext
, which shows the whole API at a glance. It doesn't yet support measuring or manipulating text, nor does it currently support functions that would be necessary for things like text editors; all of this will be added back later.CONTRIBUTING.md
for details. They are still WIP.uiWindowPosition()
and friends: uiAreaBeginUserWindowMove()
and uiAreaBeginUserWindowResize()
. When used in a uiAreaHandler.Mouse()
event handler, these let you initiate a user-driven mouse move or mouse resize of the window at any point in a uiArea.uiWindowSetContentSize()
on Unix no longer needs to call up the GTK+ main loop. As a result, bugs related to strange behavior using that function (and the now-deleted uiWindowSetPosition()
and uiWindowCenter()
) should go away. I'll need to go through the bugs to verify as much, though.uiWindowPosition()
, uiWindowSetPosition()
, uiWindowCenter()
, and uiWindowOnPositionChanged()
. Centering may come back at some point in the future, albeit in a possibly restricted form. A function to initiate a user move when a part of a uiArea is clicked will be provided soon.uiDrawTextWeightUltraBold
is now spelled correctly. Thanks to @krakjoe.uiMainSteps()
no longer takes any arguments and no longer needs to invoke a function to do the work. You still need to call it, but once you do, it will return immediately and you can then get right to your main loop.uiNewVerticalSeparator()
to complement uiNewHorizontalSeparator()
.uiWindowContentSize()
, uiWindowSetContentSize()
, and uiWindowOnContentSizeChanged()
methods for manipulating uiWindow content sizes. Note the use of "content size"; the size you work with does NOT include window decorations (titlebars, menus, etc.).uiWindowFullscreen()
and uiWindowSetFullscreen()
to allow making fullscreen uiWindows, taking advantage of OS facilities for fullscreen and without changing the screen resolution (!).uiWindowBorderless()
and uiWindowSetBorderless()
for allowing borderless uiWindows.uiMainSteps()
. You call this instead of uiMain()
if you want to run the main loop yourself. You pass in a function that will be called; within that function, you call uiMainStep()
repeatedly until it returns 0, doing whatever you need to do in the meantime. (This was needed because just having uiMainStep()
by itself only worked on some systems.)uiProgressBarValue()
and allowed passing -1 to uiProgressBarSetValue()
to make an indeterminate progress bar. Thanks to @emersion.uiFormDelete()
; thanks to @emersion.uiWindowPosition()
, uiWindowSetPosition()
, uiWindowCenter()
, and uiWindowOnPositionChanged()
, methods for manipulating uiWindow position.ChildVisibilityChanged()
method and a corresponding NotifyVisibilityChanged()
function that is called by the default show/hide handlers. This is used to make visibility changes work on OS X; uiBox, uiForm, and uiGrid all respect these now.intmax_t
and uintmax_t
are no longer used for libui API functions; now we use int
. This should make things much easier for bindings. int
should be at least 32 bits wide; this should be sufficient for all but the most extreme cases.uiGrid
, a new container control that arranges controls in rows and columns, with stretchy ("expanding") rows, stretchy ("expanding") columns, cells that span rows and columns, and cells whose content is aligned in either direction rather than just filling. It's quite powerful, is it? =PuiForm
, a new container control that arranges controls vertically, with properly aligned labels on each. Have fun!uiRadioButtonsSelected()
, uiRadioButtonsSetSelected()
, and uiRadioButtonsOnSelected()
to control selection of a radio button and catch an event when such a thing happens.uiNewPasswordEntry()
, which creates a new uiEntry
suitable for entering passwords.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.make STATIC=1
instead of just make
.libui.lib
and libui.res
AND provide a Common Controls 6 manifest for output static binaries to work properly.uiDarwinMarginAmount()
and uiDarwinPaddingAmount()
. These return the amount of margins and padding, respectively, to give to a control, and are intended for container implementations. These are suitable for the constant of a NSLayoutConstraint. They both take a pointer parameter that is reserved for future use and should be NULL
.uiCombobox
is now split into uiCombobox
for non-editable comboboxes and uiEditableCombobox
for editable comboboxes. Mind the function changes as well :)uiMainStep()
, which runs one iteration of the main loop. It takes a single boolean argument, indicating whether to wait for an event to occur or not. It returns true if an event was processed (or if no event is available if you don't want to wait) and false if the event loop was told to stop (for instance, uiQuit()
was called).uiCombobox
into two separate controls, uiCombobox
and uiEditableCombobox
, each with slightly different events and "selected item" mechanics. Prepare your existing code.uiControlVerifyDestroy()
; that is now part of uiFreeControl()
itself.uiPi
, a constant for π. This is provided for C and C++ programmers, where there is no standard named constant for π; bindings authors shouldn't need to worry about this.uiNewNonWrappingMultilineEntry()
, which creates a uiMultilineEntry that scrolls horizontally instead of wrapping lines. (This is not documented as being changeable after the fact on Windows, hence it's a creation-time choice.)WM_PRINTCLIENT
properly, which should hopefully increase the quality of screenshots.uiUserBugCannotSetParentOnToplevel()
, which should be used by implementations of toplevel controls in their SetParent()
implementations. This will also be the beginning of consolidating common user bug messages into a single place, though this will be one of the only few exported user bug functions.uiMultilineEntrySetText()
and uiMutlilineEntryAppend()
on GTK+ no longer fire OnChanged()
events.