Home

Awesome

IU

UI framework based on the Fusion/libui.cr library, with custom elements and modified bindings from hedron-crystal/hedron.

Motivation

Currently avaliable Crystal UI frameworks are either not maintained anymore or the documentation is scarce and a single error might cause a developer to lose motivation, which is why I decided to build IU on top of the LibUI framework which is a multi-platform powerful UI toolkit.

Build status

Build Status

Features

Widgets

Platforms

Code example

require "iu"

class WindowLayer < Iu::Abstractions::Layer
  def create(*args, **kwargs)
    window = create_window(
      "Hello, World", 
      {
        800,
        600
      },
      false
    )

    # Create a label and set it as the main child of the window
    window.child = create_label(
      "Everything can be sub-structured, the deeper you go the better it gets :)"
    )

    # Create a on_close handle for the current window
    window.on_close = -> (window : Iu::Ui::Window){
      self.destroy(
        *{
          window,
          args.first
        }
      )
    }

    # Render the window to the screen
    window.show
  end
end

app = Iu::Application.new
app.add_layer(WindowLayer.new)
app.start

Installation

  1. Follow the instructions for installation laid out in andlabs/libui.
  2. Copy the compiled files from step 1 (i.e. files in build/out) to /usr/lib for OSX and Linux users.
  3. Go to your shard.yml file, and enter this in:
dependencies:
  iu:
    github: grkek/iu
  1. Run shards install.

Credits

Contributors