Skip to content

Instantly share code, notes, and snippets.

@wmoxam
Created August 16, 2017 00:24
Show Gist options
  • Save wmoxam/5ec805aa02ccbbbfd3aae76a0eea6d7f to your computer and use it in GitHub Desktop.
Save wmoxam/5ec805aa02ccbbbfd3aae76a0eea6d7f to your computer and use it in GitHub Desktop.
require "motif"
app = Motif.new(ARGV, {title: "Hello"})
button = Motif.create_element(
Motif::PushButton,
{
label: "Push here to say hello"
}.to_h
)
button.add_callback {
puts "Hello from Crystal"
}
app.render(button)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment