Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henkman/odin-libui-ng
Odin libui-ng binding
https://github.com/henkman/odin-libui-ng
gui libui libui-ng native-gui odin odin-lang
Last synced: 28 days ago
JSON representation
Odin libui-ng binding
- Host: GitHub
- URL: https://github.com/henkman/odin-libui-ng
- Owner: henkman
- Created: 2023-12-29T01:00:48.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-29T22:13:03.000Z (12 months ago)
- Last Synced: 2023-12-30T23:23:22.295Z (12 months ago)
- Topics: gui, libui, libui-ng, native-gui, odin, odin-lang
- Language: Odin
- Homepage:
- Size: 2.46 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-odin - libui-ng - ng](https://github.com/libui-ng/libui-ng): a portable GUI library for C. "libui for the next generation" | None | UI, Tools (Bindings / Vendor)
- awesome-odin - libui-ng - ng](https://github.com/libui-ng/libui-ng): a portable GUI library for C. "libui for the next generation" | None | UI, Tools (Bindings / Vendor)
README
# odin-libui-ng
Binding for [Odin](https://odin-lang.org/) to [libui-ng](https://github.com/libui-ng/libui-ng)
## Install
Clone this repository into odin/shared/ui (`git clone https://github.com/henkman/odin-libui-ng.git`).
Static libraries for linux, macos and windows (all amd64) are provided.
Sample:
```
package mainimport ui "shared:ui"
main :: proc() {
if err := ui.Init(&ui.InitOptions{}); err != nil {
ui.FreeInitError(&err)
return
}
win := ui.NewWindow("hello world", 200, 30, false)
ui.WindowOnClosing(win, proc "c" (w: ^ui.Window, data: rawptr) -> bool {
ui.Quit()
return true
}, nil)
l := ui.NewLabel("Hallöchen 세계")
ui.WindowSetChild(win, l)
ui.ControlShow(win)
ui.Main()
ui.Uninit()
}
```
Note: On Windows you need to include a manifest.
Use the following in your build command:
`-resource=path_to_odin/shared/ui/windows/libui.rc`