Class: UI::Window
Direct Known Subclasses
Ektoplayer::Views::PlayingInfo, Ektoplayer::Views::Splash, LabelWidget, ListWidget
Instance Attribute Summary collapse
-
#win ⇒ Object
readonly
Returns the value of attribute win.
Attributes inherited from Widget
Instance Method Summary collapse
-
#initialize(**opts) ⇒ Window
constructor
A new instance of Window.
- #layout ⇒ Object
- #noutrefresh ⇒ Object
- #refresh ⇒ Object
Methods inherited from Widget
#display, #draw, #events, #invisible!, #invisible?, #key_press, #keys, #lock, #mouse, #mouse_click, #mouse_event_transform, #mouse_section, #on_key_press, #on_widget_raise, #raise_widget, #sub, #unlock, #visible!, #visible=, #visible?, #want_layout, #want_redraw, #want_refresh, #with_lock
Constructor Details
#initialize(**opts) ⇒ Window
Returns a new instance of Window.
144 145 146 147 148 149 150 151 |
# File 'lib/ektoplayer/ui/widgets.rb', line 144 def initialize(**opts) super(**opts) @win = ICurses.newwin(@size.height, @size.width, @pos.y, @pos.x) @win.keypad(true) @win.idlok(true) @win.leaveok(true) @win.bkgdset(UI::Colors.init_pair_cached(:default, :default)) end |
Instance Attribute Details
#win ⇒ Object (readonly)
Returns the value of attribute win.
142 143 144 |
# File 'lib/ektoplayer/ui/widgets.rb', line 142 def win @win end |
Instance Method Details
#layout ⇒ Object
153 154 155 156 157 |
# File 'lib/ektoplayer/ui/widgets.rb', line 153 def layout fail WidgetSizeError if @size.height < 1 or @size.width < 1 @win.size=(@size) @win.pos=(@pos) end |
#noutrefresh ⇒ Object
163 164 165 |
# File 'lib/ektoplayer/ui/widgets.rb', line 163 def noutrefresh @win.noutrefresh end |
#refresh ⇒ Object
159 160 161 |
# File 'lib/ektoplayer/ui/widgets.rb', line 159 def refresh @win.refresh end |