Skip to content

Instantly share code, notes, and snippets.

@fkchang
Last active February 23, 2016 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fkchang/8303383 to your computer and use it in GitHub Desktop.
Save fkchang/8303383 to your computer and use it in GitHub Desktop.
An off the top of my head idea for a high level opal framework to write web apps in. The idea is that at the level of application development, you want to stick at the level, i.e. what you see, and what it does. They way it is now, is you have to constantly do deep rabbit hole dives into markup, css, front end vs backend languages etc. The simpl…
require 'opal-tk'
app = App.new
app.main { |main|
main.vbox { |vbox|# vertical box container, auto lays out things vertically
vbox.hbox { |hbox|
hbox.header("Welcome to Opal-Tk").pack # pack means tell my parent to manage me
hbox.separator.pack
}
vbox.group_box {|group_box|
group_box.button("popup").bind("click") {
group_box.dialog_box("Surprise", "Ok").popup
}
group_box.button("quit").bind("click") {
group_box.dialg_box("Sorry to see you go", "Bye").popup
}
}
}
app.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment