All Projects → Fusion → Libui.cr

Fusion / Libui.cr

Licence: mit
Crystal-lang bindings for libui

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to Libui.cr

Egui
egui: an easy-to-use immediate mode GUI in pure Rust
Stars: ✭ 5,980 (+3438.46%)
Mutual labels:  gui
Panandzoom
Pan and zoom control for Avalonia.
Stars: ✭ 159 (-5.92%)
Mutual labels:  gui
Glow
mpv Config File Generator for Windows
Stars: ✭ 167 (-1.18%)
Mutual labels:  gui
Degate
Open source software for chip reverse engineering.
Stars: ✭ 156 (-7.69%)
Mutual labels:  gui
Vdm
GUI for command-line video downloader (youtube-dl annie)
Stars: ✭ 1,910 (+1030.18%)
Mutual labels:  gui
Streamlink Twitch Gui
A multi platform Twitch.tv browser for Streamlink
Stars: ✭ 2,059 (+1118.34%)
Mutual labels:  gui
Wxpython Tutorial
wxPython 中文简明教程
Stars: ✭ 155 (-8.28%)
Mutual labels:  gui
Gooi
LÖVE GUI Library
Stars: ✭ 168 (-0.59%)
Mutual labels:  gui
Chameleonmini Rebootedgui
Windows based GUI for Chameleon Mini, the contactless smartcard emulator (NFC/RFID)
Stars: ✭ 159 (-5.92%)
Mutual labels:  gui
Plutonium
An easy-to-use UI framework for Nintendo Switch homebrew
Stars: ✭ 166 (-1.78%)
Mutual labels:  gui
Whatsapp For Linux
An unofficial WhatsApp desktop application for Linux.
Stars: ✭ 155 (-8.28%)
Mutual labels:  gui
Oni
Oni: Modern Modal Editing - powered by Neovim
Stars: ✭ 11,466 (+6684.62%)
Mutual labels:  gui
Dial
A Rotary Dial menu for input numbers
Stars: ✭ 162 (-4.14%)
Mutual labels:  gui
Ndm
💻 npm desktop manager https://720kb.github.io/ndm
Stars: ✭ 1,904 (+1026.63%)
Mutual labels:  gui
Autopilot Rs
A simple, cross-platform GUI automation module for Rust.
Stars: ✭ 168 (-0.59%)
Mutual labels:  gui
Scrcpy Gui
👻 A simple & beautiful GUI application for scrcpy. QQ群:734330215
Stars: ✭ 2,402 (+1321.3%)
Mutual labels:  gui
Flowframes
Flowframes Windows GUI for video interpolation using DAIN (NCNN) or RIFE (CUDA/NCNN)
Stars: ✭ 157 (-7.1%)
Mutual labels:  gui
Legui
Java OpenGL GUI library. Created for using with latest LWJGL (LWJGL 3).
Stars: ✭ 167 (-1.18%)
Mutual labels:  gui
Qui
【此项目作者为刘典武,不是我自己的原创项目,望周知。也请大家不要骚扰刘典武。】一个用Qt开发的用来生成QSS文件的小程序,附简单Demo,主程序本身也可以看作一个很好的Demo。
Stars: ✭ 168 (-0.59%)
Mutual labels:  gui
Porymap
Map editor for pokeemerald, pokefirered, and pokeruby
Stars: ✭ 164 (-2.96%)
Mutual labels:  gui

libui.cr

Crystal-lang bindings for libui, a GUI library for Linux, OS X and Windows.

(well, forget about Windows for now, this is Crystal)

OS X

What's New

04/15/17

  • Sync'd to upstream #5fa7ba4
  • Updated for Crystal 0.21.1

08/13/16

  • Sync'd to upstream #6e45859
  • Control Gallery not updated, but yml examples were
  • Proper component stretching and margins
  • Waiting for tables definition to materialize

07/24/16

  • Now with YAML builder

06/19/16

  • Sync'd to upstream #9656a81
  • Control Gallery example not updated but library is.

Installation

Add these package to your dependencies in shard.yml:

dependencies:
  libui:
    github: fusion/libui.cr

Usage

Standard (C-like) usage

Have a look at examples/controlgallery, which is a direct port of a C example.

Crystal-only YAML builder

(see examples/crgallery)

This is a feature I am introducing in addition to the library bindings. It allows devs to specify a UI without hard coding it and maintain it using fragments described in simple .yml files.

Some advantages:

  • No need to recompile your code to test a UI change
  • Team collaboration now easier
  • Descriptive UI
  • Separation of concerns

Obvious drawback:

  • No compile-time checks

Note that inflating fragments and pure coding can be mixed.

API

CUI.menubar "path_to_yml_file"

CUI.inflate "path_to_yml_file"

CUI.get/CUI.get!
CUI.get_as_menuitem/CUI.get_as_menuitem!
CUI.get_mainwindow/CUI.get_mainwindow!

The '!' forms will throw an exception if component is not found.

Development

Recent versions of Crystal now require you to include the current path explicitly to find libraries:

crystal build --link-flags "-L$(pwd)" examples/controlgallery/main.cr
crystal build --link-flags "-L$(pwd)" examples/crgallery/crgallery.cr

If you omit this flag, libui.A.dylib or libui.so (system-specific) will not be found.

Note: in this example, I used the current directory but it could be -L/usr/local/includes or any other location depending on your setup.

To run the generated binaries:

LD_LIBRARY_PATH=. ./main
LD_LIBRARY_PATH=. ./crgallery

Contributing

  1. Fork it ( https://github.com/fusion/libui.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • [fusion] Chris F Ravenscroft - creator, maintainer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].