Class: Nobbie::Wx::ElementPathBuilder
- Inherits:
-
Object
- Object
- Nobbie::Wx::ElementPathBuilder
- Defined in:
- lib/nobbie/wx/impl/element/element_path_builder.rb
Instance Method Summary collapse
-
#find_component ⇒ Object
Finds the component specified in the path.
-
#initialize(name) ⇒ ElementPathBuilder
constructor
A new instance of ElementPathBuilder.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ ElementPathBuilder
Returns a new instance of ElementPathBuilder.
12 13 14 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 12 def initialize(name) @name = name end |
Instance Method Details
#find_component ⇒ Object
Finds the component specified in the path. This implementation is about as dumb as its gets, but does handle named components and menus.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 18 def find_component #todo: make me properly navigate component tree #todo: I should blow up if multiple windows with the same name are found .... #todo: shouldn't need to pass top_window here ... nil should search all component = Window.find_window_by_name(@name, TOP_WINDOW) return component unless component.nil? = TOP_WINDOW. unless .nil? component = .(.(@name)) end #todo: pull this up ... Kernel.raise(ComponentNotFoundException, "cannot find component with name: #{to_s}") if component.nil? component end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/nobbie/wx/impl/element/element_path_builder.rb', line 37 def to_s "'#{@name}'" end |