lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.2.0 vs lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.3.0
- old
+ new
@@ -184,14 +184,34 @@
@background_canvas.update
@border_canvas.update
end
+ def root
+ unless @root && @root.parent.nil?
+ @root = parent
+
+ loop do
+ if @root.parent.nil?
+ break
+ else
+ @root = @root.parent
+ end
+ end
+ end
+
+ @root
+ end
+
def recalculate
raise "#{self.class}#recalculate was not overridden!"
end
def value
raise "#{self.class}#value was not overridden!"
+ end
+
+ def value=(value)
+ raise "#{self.class}#value= was not overridden!"
end
end
end
\ No newline at end of file