Skip to content

feat: Port control gallery example from libui-ng#14

Open
jthat wants to merge 4 commits into
desttinghim:mainfrom
jthat:port-controlgallery-example
Open

feat: Port control gallery example from libui-ng#14
jthat wants to merge 4 commits into
desttinghim:mainfrom
jthat:port-controlgallery-example

Conversation

@jthat

@jthat jthat commented Jun 12, 2025

Copy link
Copy Markdown

This is a port of the control gallery example from libui-ng.

This fills in some missing examples, such as Slider, Group, ProgressBar, RadioButtons, FontButton, ColorButton, Grid, Tab, and Window.MsgBox().

I discovered a few issues along the way covered in #11, #12, and #13; this work depends on those.

I have tried to keep the coding style consistent with the other examples. I have also manually tested all of the controls to ensure they work in the same way as the C example.

Feel free to use the below screenshots however you see fit (e.g. for #7).

Screenshot_20250612_181716
Screenshot_20250612_181803
Screenshot_20250612_181813

jthat added 4 commits June 12, 2025 17:39
`ui.Spinbox.New()` defines a `TypeEnum` containing an `Integer`
struct for representing the min and max values. This was missing from
`ui.Slider.New()`, which accepted the values as individual arguments.

Since precisely the same concept of min and max applies to both a slider
and a spinbox, their API should be consistent.
@rubyFeedback

Copy link
Copy Markdown

I think this is a great idea.

kojix2 was also busy with examples for uing (libui-ng for crystal) - see here:

https://github.com/kojix2/uing#examples-gallery

It would be great if we could "standardize" on the same or similar set of
examples. I am not necessarily saying that everyone should copy/paste
what kojix2 did 1:1, mind you - but I think having extensive examples in
all language bindings would be really neat. New users could chime in
and learn more readily so. More users in the long run.

libui-ng is a bit idle right now, but I think sooner or later some folks may
get the project going again, just as libui-ng was a fork of libui, starting
adding several patches that were suggested to libui upstream but not
merged in due to andlabs not having the time/energy for more work at
that moment in time. If we get the project going, we should also have
several maintainers, so that the project does not too much depend on
single people who may burn out or have to invest their time for other
things (understandably so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants