Hi everyone!
I created a fork of [ui](https://github.com/nim-lang/ui) that wraps
[libui-ng](https://github.com/libui-ng/libui-ng) instead of the old and
unmaintained [libui](https://github.com/andlabs/libui) library. I made this
fork because libui seems to be abandoned (ATOW, most recent update to libui was
2 years ago), and `ui` hasn't been updated in a long time aswell
(coincidentally, the most recent change also happens to be 2 years ago).
Some features that `uing` implements that aren't in `ui` are:
* More widgets (Grids, DateTimePickers, ColorButtons, Areas, etc.)
* Timers
* Improved callbacks
* more...
The source code can can be found here: <https://github.com/neroist/uing>
## Installation
You can install via Nimble: `nimble install uing`
## Documentation
UIng's documentation is hosted here: <https://neroist.github.io/uing/uing.html>
You can find examples
[here](https://github.com/neroist/uing/tree/main/examples).
For `rawui` I suggest you look at libui-ng's official docs, which can be found
[here](https://libui-ng.github.io/libui-ng/).
## Example
Heres the `datetime` example written with uing: (original C code
[here](https://github.com/libui-ng/libui-ng/blob/master/examples/datetime/main.c))
import std/times
import uing
proc main =
let window = newWindow("Date / Time", 320, 240)
window.margined = true
let grid = newGrid(true)
window.child = grid
let
dateTimeLabel = newLabel()
dateLabel = newLabel()
timeLabel = newLabel()
dateTimePicker = newDateTimePicker() do (dt: DateTimePicker):
dateTimeLabel.text = dt.time.format("ddd MMM d HH:mm:ss UUUU")
datePicker = newDatePicker() do (dt: DateTimePicker):
dateLabel.text = dt.time.format("yyyy-MM-dd")
timePicker = newTimePicker() do (dt: DateTimePicker):
timeLabel.text = dt.time.format("hh:mm:ss")
nowButton = newButton("Now") do (_: Button):
timePicker.time = now()
datePicker.time = now()
epochButton = newButton("Unix epoch") do (_: Button):
dateTimePicker.time = dateTime(1969, mDec, 31, 19)
grid.add(dateTimePicker, 0, 0, 2, 1, true, AlignFill, false, AlignFill)
grid.add(datePicker, 0, 1, 1, 1, true, AlignFill, false, AlignFill)
grid.add(timePicker, 1, 1, 1, 1, true, AlignFill, false, AlignFill)
grid.add(dateTimeLabel, 0, 2, 2, 1, true, AlignCenter, false, AlignFill)
grid.add(dateLabel, 0, 3, 1, 1, true, AlignCenter, false, AlignFill)
grid.add(timeLabel, 1, 3, 1, 1, true, AlignCenter, false, AlignFill)
grid.add(nowButton, 0, 4, 1, 1, true, AlignFill, true, AlignEnd)
grid.add(epochButton, 1, 4, 1, 1, true, AlignFill, true, AlignEnd)
show window
mainLoop()
init()
main()
Run
This results in this application on Windows: