All Projects → ba0f3 → uibuilder.nim

ba0f3 / uibuilder.nim

Licence: MIT License
UI prototyping w/ Glade for lazy me

Programming Languages

nim
578 projects

Projects that are alternatives of or similar to uibuilder.nim

scalaui
Scala Native GUI framework based on libui
Stars: ✭ 56 (+166.67%)
Mutual labels:  gtk, libui
100 Words Design Patterns Java
GoF Design Patterns, each pattern described with story from real life.
Stars: ✭ 117 (+457.14%)
Mutual labels:  builder, prototype
Crossui
CrossUI is a free Cross-Browser Javascript framework with cutting-edge functionality for rich web application
Stars: ✭ 945 (+4400%)
Mutual labels:  builder, rad
oh-my-design-patterns
🎨 Record the articles and code I wrote while learning design patterns
Stars: ✭ 33 (+57.14%)
Mutual labels:  builder, prototype
hotbuild
a cross platform hot compilation tool for golang
Stars: ✭ 181 (+761.9%)
Mutual labels:  builder
Dotfiles
🌸 Configuration for i3, kitty, picom, ZSH, gtk, qutebrowser, qbittorrent and more... (All tools for an arch linux new installation)
Stars: ✭ 15 (-28.57%)
Mutual labels:  gtk
akbl
Control the lights of Alienware computers under GNU/Linux systems.
Stars: ✭ 99 (+371.43%)
Mutual labels:  gtk
shortcut-overlay
A native, OS-wide shortcut overlay
Stars: ✭ 26 (+23.81%)
Mutual labels:  gtk
quickmd
Quickly preview a markdown file
Stars: ✭ 24 (+14.29%)
Mutual labels:  gtk
wingpanel-indicator-bluetooth
Wingpanel Bluetooth Indicator
Stars: ✭ 18 (-14.29%)
Mutual labels:  gtk
date-countdown
A date countdown applet
Stars: ✭ 15 (-28.57%)
Mutual labels:  gtk
slim-routing
Slim framework powered-up routing
Stars: ✭ 14 (-33.33%)
Mutual labels:  builder
FlowUpdater
The free and open source solution to update Minecraft.
Stars: ✭ 54 (+157.14%)
Mutual labels:  builder
webviewhs
🌐 A Haskell binding to the webview library created by Serge Zaitsev.
Stars: ✭ 109 (+419.05%)
Mutual labels:  gtk
hello-libui
Hello World application using libui from maven repository
Stars: ✭ 17 (-19.05%)
Mutual labels:  libui
github-action
Synopsys Detect integration with Github Actions
Stars: ✭ 15 (-28.57%)
Mutual labels:  prototype
Lua-GTK3-Examples
Some GTK examples in Lua
Stars: ✭ 20 (-4.76%)
Mutual labels:  gtk
launchui
Launcher for GUI Node.js applications using libui-node.
Stars: ✭ 107 (+409.52%)
Mutual labels:  libui
obozrenie
Simple and easy to use game server browser.
Stars: ✭ 25 (+19.05%)
Mutual labels:  gtk
Spedread
GTK speed reading software: Read like a speedrunner!
Stars: ✭ 23 (+9.52%)
Mutual labels:  gtk

uibuilder.nim

UI Builder for @nim-lang/ui using Glade

Checkout examples

Usage

you must have Glade installed in order to build UI and create *.glade files

$ nimble install uibuilder

UIBuilder contains a library for load glade file and construct UI on-the-fly, another part - uibuilder binary - which generates a Nim module from glade file.

Construct UI at compile-time

This method is prefered:

  • Glade file compiled into AST at compile-time
  • No more glade files in your distribution package
  • Output module wont depends on UIBuilder
  • Binary size reduced 50%
import ui, ospaths, uibuilderpkg/codegen

const path = joinPath(staticExec("pwd"), "test.glade")

init()
build(path)
mainLoop()

Load Glade on run-ime file

import ui, uibuilder

var builder = newBuilder()
builder.load("ui.glade")
builder.run()

Generate Nim module (WIP)

the uibuilder command will generates a Nim module which can run standalone or importable. the generated module will not requires uibuilder, it just need ui module

Note: only widgets have id are exported

$ uibuilder examples/basic_controls.glade
Nim code saved at: examples/basic_controls.nim
Run command bellow to see the result:

# nim c -r examples/basic_controls.nim

Showcases:

Widgets

Almost widgets are same as GTK Widgets, but there are some widgets need a small hack in order to work

Group

UI Builder converts GtkFrame into a Group, it will finds nested GtkLabel and make it as Group's title

RadioButtons

In Glade, you must cover a group of GtkRadioButtons with a GtkBox, the box must have a style class named radiobuttons

Tab

Tab uses GtkNotebook, tab's container must be a GtkBox

MultilineEntry

Just add a GtkTextView widget to make a MultilineEntry, you also can pre-define text for it w/ GtkTextBuffer

Menu

libui requires to init Menu first, before creating main Window, so it better make a GtkMenuBar separated

Slider

Slider uses GtkScale You can defined ajustment for Slider and SpinBox with GtkAdjustment

examples

Todos

  • Better event handling
  • Code generator for static layout
  • Support QT Designer layout file
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].