Class: RubyCurses::Tab
- Defined in:
- lib/rbcurse/core/widgets/rtabbedpane.rb
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.
533 534 535 536 537 538 539 540 541 542 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 533 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
530 531 532 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 530 def @button end |
#col_offset ⇒ Object
Returns the value of attribute col_offset.
532 533 534 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 532 def col_offset @col_offset end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
526 527 528 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 526 def config @config end |
#index ⇒ Object
Returns the value of attribute index.
529 530 531 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 529 def index @index end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
527 528 529 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 527 def items @items end |
#parent_component ⇒ Object
Returns the value of attribute parent_component.
528 529 530 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 528 def parent_component @parent_component end |
#row_offset ⇒ Object
Returns the value of attribute row_offset.
531 532 533 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 531 def row_offset @row_offset end |
#text ⇒ Object
Returns the value of attribute text.
525 526 527 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 525 def text @text end |
Instance Method Details
#item(widget) ⇒ Object
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/rbcurse/core/widgets/rtabbedpane.rb', line 543 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?(RubyCurses::Container) #|| widget.respond_to?(:width) .width ||= @parent_component.width-3 end # Darn ! this was setting Label to fully height if .kind_of?(RubyCurses::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 |