https://github.com/grkek/murg
An experimental GUI framework with GTK4 component generation using HTML, CSS and JavaScript
https://github.com/grkek/murg
Last synced: 2 months ago
JSON representation
An experimental GUI framework with GTK4 component generation using HTML, CSS and JavaScript
- Host: GitHub
- URL: https://github.com/grkek/murg
- Owner: grkek
- License: mit
- Created: 2022-09-29T06:57:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-14T18:12:48.000Z (about 2 years ago)
- Last Synced: 2025-04-20T18:38:54.717Z (3 months ago)
- Language: Crystal
- Size: 481 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Murg
[](https://github.com/grkek/murg)
### GUI framework with GTK4 component generation using HTML, CSS and JavaScript
- None of the components generated by Layout contain anything remotely related to a Web-Browser.
- Compiled binary reads the custom HTML and builds the GTK components. Since it is already a pre-built release version, it is pretty fast at generating the UI components.
- The compiler supports CSS and JavaScript compilation, which glues the components and makes the UI interactive.
- The JavaScript engine is Duktape, it supports Babel 6.26.0 and CoreJS 2.6.11.
- The CSS is limited to GTK4 specification.
## Installation
Before you clone the shard and build it, install the GTK libraries.
Add this to your application's `shard.yml`:
```yaml
dependencies:
murg:
github: grkek/murg
```And run this command in your terminal:
```bash
shards install
./bin/gi-crystal
```# Code example
Add this to your `application.cr`:```crystal
require "murg"# Disable GC for because of invalid memory access bug.
GC.disablehtml = <<-HTML
Hello, World!
HTMLbuilder = Murg::Builder.new
# Make sure you point the path the correct way.
builder.build_from_string(html)
```Compile the `application.cr` file.
```bash
crystal run application.cr -Dpreview_mt --error-trace
```And you should have a GUI window with a "Hello, World!" text.