https://github.com/muesli4/libwtk-sdl2
Simplistic SDL2 GUI framework in early developement.
https://github.com/muesli4/libwtk-sdl2
event-handling gui gui-framework sdl sdl2 sdl2-gui widget
Last synced: about 1 month ago
JSON representation
Simplistic SDL2 GUI framework in early developement.
- Host: GitHub
- URL: https://github.com/muesli4/libwtk-sdl2
- Owner: muesli4
- Created: 2018-01-30T06:25:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T05:21:27.000Z (about 3 years ago)
- Last Synced: 2025-11-21T12:04:30.422Z (5 months ago)
- Topics: event-handling, gui, gui-framework, sdl, sdl2, sdl2-gui, widget
- Language: C++
- Homepage:
- Size: 602 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSES/LGPL-3.0-or-later.txt
Awesome Lists containing this project
README
Provides a framework for hierarchic widgets based on SDL2. Most of the event handling and drawing is however abstracted away and should be easily replacable. The original purpose of this library is to supersede my quick and dirty *immediate GUI* implementation in my [touchscreen GUI](https://github.com/muesli4/mpd-touch-screen-gui) and at the same time provide GUI support for a remote control.
## Installation
Run `autoreconf -vfi` to generate the configure script. Then build as usual with `./configure`, `make`, and `make install`.
## Features
* Clean and easy to use (mostly declarative) GUI building with modern C++.
* Simple widget hierarchy with useful base classes. New widgets can be created by deriving.
* Flexible widget containers: (h/v)box and table.
* Support for widget selection. In addition selectable widgets can be navigated in 2 dimensions. The intention was to support faster and more intuitive keyboard or infra-red remote navigation.
* Optional dirty-based drawing: Only dirty widgets will be redrawn.
## Documentation
I uploaded an early snapshot of the API [here](https://muesli4.github.io/annotated.html).
## Current Shortcomings
* Only a basic dark hard-coded theme is provided.
* Missing widget to enter text.
* Keyboard events are not handled by widgets.
* Widgets do not get a new size when their content changes. There are several desirable behaviors how this could work.
* Containers do not have interfaces to add or remove children. This would also require redoing the allocation.
* The drawing primitives are lacking (should probably be refactored into low-level and design-based drawing).
* The font renderer is optimized on reoccuring words. Rendering arbitrary text with it might use a lot of memory (although it will trade off with rerendering).
* Backgrounds can not easily redrawn if a child is dirty (although no widgets need that yet).
* Widgets can't unselect themselves or others (bad if a selection gets covered).
## Examples
