Class: RTabItemComposite

Inherits:
RWidget show all
Defined in:
lib/command_handlers/models/r_tab_item_composite.rb

Instance Attribute Summary collapse

Attributes inherited from RWidget

#widget

Instance Method Summary collapse

Methods inherited from RWidget

#add_listener, #async_exec, #can_add_listener?, #has_style?, #process_block, #sync_exec, widget_exists?, #widget_listener_exists?

Methods included from Parent

#process_block

Constructor Details

#initialize(tab_item, parent, style, &contents) ⇒ RTabItemComposite

Returns a new instance of RTabItemComposite.



8
9
10
11
12
# File 'lib/command_handlers/models/r_tab_item_composite.rb', line 8

def initialize(tab_item, parent, style, &contents)
  super("composite", parent, style, &contents)
  @tab_item = tab_item
  @tab_item.widget.control = self.widget
end

Instance Attribute Details

#tab_itemObject (readonly)

Returns the value of attribute tab_item.



7
8
9
# File 'lib/command_handlers/models/r_tab_item_composite.rb', line 7

def tab_item
  @tab_item
end

Instance Method Details

#has_attribute?(attribute_name, *args) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/command_handlers/models/r_tab_item_composite.rb', line 14

def has_attribute?(attribute_name, *args)
  if attribute_name.to_s == "text"
    true
  else
    super(attribute_name, *args)
  end
end

#set_attribute(attribute_name, *args) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/command_handlers/models/r_tab_item_composite.rb', line 22

def set_attribute(attribute_name, *args)
  if attribute_name.to_s == "text"
    text_value = args[0]
    @tab_item.widget.text = text_value
  else
    super(attribute_name, *args)
  end
end