Class: Canis::Tab
Overview
class
Instance Attribute Summary collapse
-
#button ⇒ Object
so you can set an event on it 2011-10-4.
-
#col_offset ⇒ Object
Returns the value of attribute col_offset.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#index ⇒ Object
Returns the value of attribute index.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#parent_component ⇒ Object
Returns the value of attribute parent_component.
-
#row_offset ⇒ Object
Returns the value of attribute row_offset.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text, parent_component, aconfig = {}, &block) ⇒ Tab
constructor
A new instance of Tab.
- #item(widget) ⇒ Object
Constructor Details
#initialize(text, parent_component, aconfig = {}, &block) ⇒ Tab
Returns a new instance of Tab.
549 550 551 552 553 554 555 556 557 558 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 549 def initialize text, parent_component, aconfig={}, &block @text = text @items = [] @config = aconfig @parent_component = parent_component @row_offset ||= 2 @col_offset ||= 2 @config.each_pair { |k,v| variable_set(k,v) } instance_eval &block if block_given? end |
Instance Attribute Details
#button ⇒ Object
so you can set an event on it 2011-10-4
546 547 548 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 546 def @button end |
#col_offset ⇒ Object
Returns the value of attribute col_offset.
548 549 550 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 548 def col_offset @col_offset end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
542 543 544 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 542 def config @config end |
#index ⇒ Object
Returns the value of attribute index.
545 546 547 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 545 def index @index end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
543 544 545 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 543 def items @items end |
#parent_component ⇒ Object
Returns the value of attribute parent_component.
544 545 546 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 544 def parent_component @parent_component end |
#row_offset ⇒ Object
Returns the value of attribute row_offset.
547 548 549 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 547 def row_offset @row_offset end |
#text ⇒ Object
Returns the value of attribute text.
541 542 543 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 541 def text @text end |
Instance Method Details
#item(widget) ⇒ Object
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/canis/core/widgets/rtabbedpane.rb', line 559 def item .form = @parent_component.form .override_graphic @parent_component.form.window # these will fail if TP put inside some other container. NOTE .row ||= 0 .col ||= 0 # If we knew it was only widget we could expand it if .kind_of?(Canis::Container) #|| widget.respond_to?(:width) .width ||= @parent_component.width-3 end # Darn ! this was setting Label to fully height if .kind_of?(Canis::Container) #|| widget.respond_to?(:height) .height ||= @parent_component.height-3 end # i don't know button_offset as yet .row += @row_offset + @parent_component.row + 1 .col += @col_offset + @parent_component.col @items << end |