Skip to content

Instantly share code, notes, and snippets.

@AndyObtiva
Created April 11, 2020 01:33
Show Gist options
  • Save AndyObtiva/fb1471bd8606d3c81d5709dc113d5928 to your computer and use it in GitHub Desktop.
Save AndyObtiva/fb1471bd8606d3c81d5709dc113d5928 to your computer and use it in GitHub Desktop.
# You may clone glimmer repo, follow setup instructions, and run bin/girb then copy/paste code below
class RedLabel
include Glimmer::UI::CustomWidget
before_body {
@color = color(:red)
}
after_body {
body_root.on_mouse_up {
message_box = MessageBox.new(swt_widget.getShell)
message_box.setText("Red Label")
message_box.setMessage("This is a Red Label")
message_box.open
}
}
body {
label(:center) {
background @color
}
}
end
shell {
text 'Example'
red_label {
text 'Click Me'
font height: 20
}
}.open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment