Class: Ruvi::Widget

Inherits:
Object
  • Object
show all
Defined in:
lib/widgets.rb

Direct Known Subclasses

Box, DocView, Ruler, StatusBar

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, buffer) ⇒ Widget

Returns a new instance of Widget.



104
105
106
107
108
# File 'lib/widgets.rb', line 104

def initialize app, buffer
    @app, @buffer = app, buffer
    @cursor = Point.new 0, 0
    @parent = nil
end

Instance Attribute Details

#bufferObject

Returns the value of attribute buffer.



103
104
105
# File 'lib/widgets.rb', line 103

def buffer
  @buffer
end

#cursorObject

Returns the value of attribute cursor.



103
104
105
# File 'lib/widgets.rb', line 103

def cursor
  @cursor
end

#parentObject

Returns the value of attribute parent.



103
104
105
# File 'lib/widgets.rb', line 103

def parent
  @parent
end

Instance Method Details

#heightObject



112
113
114
# File 'lib/widgets.rb', line 112

def height
    raise "height must be implemented in sub classes!"
end

#watch_bufferObject



115
116
117
# File 'lib/widgets.rb', line 115

def watch_buffer
    nil
end

#widthObject



109
110
111
# File 'lib/widgets.rb', line 109

def width
    raise "width must be implemented in sub classes!"
end