Giter VIP home page Giter VIP logo

haki's Introduction

Haki

Showcase

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:

dependencies:
  haki:
    github: grkek/haki

And run this command in your terminal:

shards install
./bin/gi-crystal

Code example

Add this to your application.cr:

require "haki"

# Disable GC for now.
GC.disable

html = <<-HTML
  <Application applicationId="com.haki.application">
    <Window title="Untitled Window">
      <Label>Hello, World!</Label>
    </Window>
  </Application>
HTML

builder = Haki::Builder.new
# Make sure you point the path the correct way.
builder.build_from_string(html)

Compile the application.cr file.

crystal run application.cr -Dpreview_mt --error-trace

And you should have a GUI window with a "Hello, World!" text.

haki's People

Contributors

grkek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

haki's Issues

Random Crashes

Layout Version

commit 8df4f2b

System information

Arch KDE Plasma 5.22.5, Linux kernel 5.14.3

Issue description

When running the default example program, it spontaneously crashes, sometimes it will work and sometimes it won't. When it crashes the error message it gives is either:

Building components...
Finished: 14.17ms
"T"
"Th"
"Thi"
"This"
"This "
"This i"
"This is"
"This is "
"This is a"
"This is an"
"This is an "
"This is an e"
"This is an ex"
"This is an exa"
"This is an exam"
"This is an examp"
"This is an exampl"
"This is an example"
Invalid memory access (signal 11) at address 0x55ba65bfca00
[0x55ba652d1026] *Exception::CallStack::print_backtrace:(Int32 | Nil) +118
[0x55ba652b364a] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +330
[0x7f6b6f18d870] ???
[0x55ba65bfca00] ???

(at some random address)
or

Building components...
Finished: 14.28ms
"T"
"Th"
"Thi"
"This"
"This "
"This i"
"This is"
"This is "
"This is a"
"This is an"
"This is an "
"This is an e"
"This is an ex"
"This is an exa"
"This is an exam"
Invalid memory access (signal 11) at address 0x0
[0x55c2ce9ed026] *Exception::CallStack::print_backtrace:(Int32 | Nil) +118
[0x55c2ce9cf64a] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +330
[0x7f536129a870] ???
[0x0] ???

(at address 0x0)

Steps to reproduce

Follow the README.md instruction and run the default program. Then just click some buttons and type some text and it should crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.