Skip to content

rubiojr/cute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cute — Light up your desktop

Cute Documentation

A declarative UI toolkit for Rugo.

Build native desktop apps with do...end blocks, reactive state, and zero ceremony.

require "github.com/rubiojr/cute@v0.1.1"

cute.app("Counter", 400, 300) do
  count = cute.state(0)

  cute.vbox do
    lbl = cute.label("Clicked: 0 times")
    count.on(fn(v) lbl.set_text("Clicked: #{v} times") end)

    cute.button("Click Me") do
      count.set(count.get() + 1)
    end

    cute.hbox do
      cute.button("Reset") do
        count.set(0)
      end
      cute.button("Quit") do
        cute.quit()
      end
    end
  end

  cute.shortcut("Ctrl+Q", fn() cute.quit() end)
end

Tutorial

  1. Getting Started — Prerequisites, hello world, build & run
  2. Layouts & Widgets — vbox, hbox, label, button, input, and more
  3. Reactive Statestate(), .get(), .set(), .on()
  4. Styling — Stylesheets, style() helper, props()
  5. Events & Shortcuts — Callbacks, keyboard shortcuts, timers
  6. Threading — Background work with spawn and cute.ui
  7. API Reference — Complete function reference

Examples

About

Light up your desktop.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published