Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olexij-christian/zgtk3
Implementation gtk3 for Zig programming language
https://github.com/olexij-christian/zgtk3
Last synced: 3 months ago
JSON representation
Implementation gtk3 for Zig programming language
- Host: GitHub
- URL: https://github.com/olexij-christian/zgtk3
- Owner: olexij-christian
- Created: 2024-08-04T20:02:00.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T15:07:45.000Z (3 months ago)
- Last Synced: 2024-08-07T10:26:35.735Z (3 months ago)
- Language: Zig
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zgtk3
zgtk3 is a library currently in development that aims to implement GTK3 for the Zig programming language. This project will enable developers to create graphical user interfaces (GUIs) using Zig.
## Features
- Build applications from templates as zig structures using `buildInterface()`
- Run command-line commands more simply using `executeCommand()`## Installation
See in releases of project.
## Usage
Once completed, zgtk3 will allow for creating windows and other GUI elements in Zig. Here is a simple example of what the usage might look like:
```zig
const gtk = @import("zgtk3");const buildInterface = gtk.buildInterface;
const c = gtk.c;
pub fn main() !u8 {
c.gtk_init(0, null);_ = buildInterface(@import("ui.zig").template);
c.gtk_main();
return 0;
}
```ui.zig
```zig
const c = @import("gtk").c;pub const template = .{
.class = "window",
.args = .{c.GTK_WINDOW_TOPLEVEL},
.@"window:title" = "Hello World!",
.@"window:default_size" = .{ 400, 600 },.@"widget:visible" = 1,
.children = .{.{
.class = "button",
.@"widget:visible" = 1,
.@"button:label" = "Test",
}},
};
```## Documentation
Comprehensive documentation will be available once the project is further along in development.
## Example
Just run
``` zig build example ```
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
## Acknowledgements
I am grateful to Jesus Christ for giving me the strength and inspiration to work on this project.