|
Nuklear
This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed as a simple embeddable user interface for application and does not have any dependencies, a default render backend or OS window/input handling but instead provides a highly modular, library-based approach, with simple input state for input and draw commands describing primitive shapes as output. So instead of providing a layered library that tries to abstract over a number of platform and render backends, it focuses only on the actual UI.
|
=============================================================================
GROUP
=============================================================================
Groups are basically windows inside windows. They allow to subdivide space in a window to layout widgets as a group. Almost all more complex widget layouting requirements can be solved using groups and basic layouting fuctionality. Groups just like windows are identified by an unique name and internally keep track of scrollbar offsets by default. However additional versions are provided to directly manage the scrollbar.
To create a group you have to call one of the three nk_group_begin_xxx functions to start group declarations and nk_group_end at the end. Furthermore it is required to check the return value of nk_group_begin_xxx and only process widgets inside the window if the value is not 0. Nesting groups is possible and even encouraged since many layouting schemes can only be achieved by nesting. Groups, unlike windows, need nk_group_end to be only called if the corresponding nk_group_begin_xxx call does not return 0:
In the grand concept groups can be called after starting a window with nk_begin_xxx and before calling nk_end:
| Function | Description |
|---|---|
| nk_group_begin | Start a new group with internal scrollbar handling |
| nk_group_begin_titled | Start a new group with separated name and title and internal scrollbar handling |
| nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero |
| nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset |
| nk_group_scrolled_begin | Start a new group with manual scrollbar handling |
| nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero |
| nk_group_get_scroll | Gets the scroll offset for the given group |
| nk_group_set_scroll | Sets the scroll offset for the given group |