Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/can-lehmann/owlkettle
A declarative user interface framework based on GTK 4
https://github.com/can-lehmann/owlkettle
declarative declarative-ui framework gtk gtk4 gui nim ui user-interface
Last synced: 6 days ago
JSON representation
A declarative user interface framework based on GTK 4
- Host: GitHub
- URL: https://github.com/can-lehmann/owlkettle
- Owner: can-lehmann
- License: mit
- Created: 2022-03-08T21:32:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T20:35:43.000Z (21 days ago)
- Last Synced: 2024-11-28T17:22:12.865Z (15 days ago)
- Topics: declarative, declarative-ui, framework, gtk, gtk4, gui, nim, ui, user-interface
- Language: Nim
- Homepage: https://can-lehmann.github.io/owlkettle/README
- Size: 5.83 MB
- Stars: 383
- Watchers: 10
- Forks: 13
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-electron-alternatives - Owlkettle
- awesome-nim - Owlkettle - Declarative user interface framework based on GTK. (User Interface / GUI)
README
# Owlkettle
*Freshly brewed user interfaces.*Owlkettle is a declarative user interface framework based on GTK.
It is written in Nim.Here is an example for a simple counter app. When you click on the "+" Button, the counter increments.
```nim
import owlkettleviewable App:
counter: intmethod view(app: AppState): Widget =
result = gui:
Window:
title = "Counter"
defaultSize = (200, 60)Box(orient = OrientX, margin = 12, spacing = 6):
Label(text = $app.counter)
Button {.expand: false.}:
text = "+"
style = [ButtonSuggested]
proc clicked() =
app.counter += 1brew(gui(App()))
```The code above will result in the following application:
Owlkettle also supports building libadwaita apps.
To enable libadwaita, import `owlkettle/adw` and change the last line to `adw.brew(gui(App()))`.## Installation
Owlkettle requires GTK 4 to be installed on your system.
You can install it by running:
- `dnf install gtk4-devel libadwaita-devel` on Fedora
- `apt install libgtk-4-dev libadwaita-1-dev` on Ubuntu
- `pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-libadwaita` on Windows' MSYS2
- [Checkout the installation docs](https://can-lehmann.github.io/owlkettle/docs/installation.html) for more information about the MSYS2 setup```bash
$ nimble install owlkettle
```Check out [the installation guide](https://can-lehmann.github.io/owlkettle/docs/installation.html) for further instructions.
## Documentation
You can find a reference of all widgets in [docs/widgets.md](https://github.com/can-lehmann/owlkettle/blob/main/docs/widgets.md).
A tutorial for building a simple Todo application can be found [here](https://can-lehmann.github.io/owlkettle/docs/tutorial.html).
Additional examples can be found [here](https://can-lehmann.github.io/owlkettle/examples/README.html).
A reference of all supported libadwaita widgets can be found in [docs/widgets_adwaita.md](https://github.com/can-lehmann/owlkettle/blob/main/docs/widgets_adwaita.md).
## License
Owlkettle is licensed under the MIT license.
See `LICENSE.txt` for more information.