iu

UI framework based on the Fusion/libui.cr library, with custom elements and modified bindings from hedron-crystal/hedron libui gui ui user-interface reusable-components
0.0.2 released

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

  • Horizontal box, Vertical box, Checkbox, Combobox, Editable combobox.
  • Button, Font button, Color button, Radio button.
  • Datetime picker, Progress bar, Slider, Spinbox.
  • Text entry, Multiline text entry.
  • Form, Grid, Group, Table, Tab, Separator.
  • Image, Label.
  • Window, Menubar.
  • Many more.

Platforms

  • Mac OSX
  • Linux

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.undo(
        *{
          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

  • Qwerp-Derp Hanyuan Li - original creator
  • grkek Giorgi Kavrelishvili - creator, maintainer
iu:
  github: grkek/iu
  version: ~> 0.0.2
License MIT
Crystal 0.35.1

Authors

Dependencies 1

  • stumpy_png ~>4.4.1
    {'github' => 'stumpycr/stumpy_png', 'version' => '~>4.4.1'}

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently