NoMethodError for button#on_action in HotCocoa
21 Apr
2009
21 Apr
'09
8:27 a.m.
Got two unexpected results from running this script in HotConsole: require 'hotcocoa' include HotCocoa w = window(:title => "Window", :size => [220,100]) $lv = layout_view :frame => [0,0,200,80], :layout => {:expand => [:width, :height], :align => :center, :start => true} do |view| view << $l = label(:text_align => :center, :text => "", :layout => {:expand => [:width, :height], :align => "center"}) view << $btn = button(:title => "Put some text in the label", :layout => {:align => "center"}) end w << $lv $btn.on_action($l.text = "some text") Expected: Nothing Got: NoMethodError: undefined method `on_action' for 0:NSButton hotconsole:13:in `<compiled>' Expected: Text label to be empty Got: "some text"
6046
Age (days ago)
6046
Last active (days ago)
0 comments
1 participants
participants (1)
-
Frisco Del Rosario