Created
October 18, 2008 17:52
-
-
Save wfarr/17701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'hotcocoa' | |
| include HotCocoa | |
| application do |app| | |
| window :size => [200, 100] do |win| | |
| win.view = layout_view :mode => :vertical do |layout| | |
| layout.spacing = 10 | |
| btn = button(:title => "click me", :layout => {:align => :center}) | |
| lbl = label(:text => "text", :layout => {:align => :center}) | |
| btn.on_action do |b| | |
| if lbl == "text" || lbl == "World foo" | |
| lbl.text = "Hello" | |
| else | |
| lbl.text = "World foo" | |
| end | |
| end | |
| layout << btn | |
| layout << lbl | |
| end | |
| win.will_close { exit } | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment