lib/shoes/basic.rb in green_shoes-0.243.0 vs lib/shoes/basic.rb in green_shoes-0.255.0

- old
+ new

@@ -8,10 +8,11 @@ end (@app.order << self) unless @noorder or self.is_a?(EditBox) or self.is_a?(EditLine) (@app.cslot.contents << self) unless @nocontrol or @app.cmask (@app.cmask.contents << self) if @app.cmask + (@app.focusables << self) if self.is_a? Native @parent = @app.cslot Basic.class_eval do attr_accessor *args.keys end @@ -245,10 +246,14 @@ class Native < Basic def change obj, &blk obj.signal_connect "changed", &proc{parent.append{blk[self]}} if blk end + + def focus + @app.focus_ele = self + end end class Button < Native def click &blk real.signal_connect "clicked", &proc{parent.append{blk[self]}} if blk end @@ -261,11 +266,16 @@ def checked=(tof) real.active = tof end end class Check < ToggleButton; end - class Radio < ToggleButton; end + class Radio < ToggleButton + def focus + self.checked = true + super + end + end class EditLine < Native def text @real.text end @@ -328,7 +338,9 @@ end def fraction= n real.fraction = n end + + undef_method :focus end end