Class: ICurses::IWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/ektoplayer/ui.rb,
lib/ektoplayer/icurses/sugar.rb

Instance Method Summary collapse

Instance Method Details

#append_bottomObject



339
340
341
342
343
# File 'lib/ektoplayer/ui.rb', line 339

def append_bottom
   move(0, 0)
   deleteln
   move(maxy - 1, 0)
self end

#center(size) ⇒ Object



327
# File 'lib/ektoplayer/ui.rb', line 327

def center(size)     move(cury, (maxx / 2) - (size / 2))  ;self;end

#center_string(string) ⇒ Object



329
330
331
332
# File 'lib/ektoplayer/ui.rb', line 329

def center_string(string)
   center(string.size)
   addstr(string)
self end

#cursorObject



296
# File 'lib/ektoplayer/ui.rb', line 296

def cursor;  UI::Point.new(y: cury, x: curx)           end

#cursor=(new) ⇒ Object



300
301
302
# File 'lib/ektoplayer/ui.rb', line 300

def cursor=(new)
   move(new.y, new.x)  #or warn "Could not set cursor: #{new} #{size}"
end

#from_left(size) ⇒ Object



325
# File 'lib/ektoplayer/ui.rb', line 325

def from_left(size)  move(cury, size)                     ;self;end

#from_right(size) ⇒ Object



326
# File 'lib/ektoplayer/ui.rb', line 326

def from_right(size) move(cury, (maxx - size))            ;self;end

#getch1(timeout = -1)) ⇒ Object



316
317
318
319
# File 'lib/ektoplayer/ui.rb', line 316

def getch1(timeout=-1)
   self.timeout(timeout)
   getch
end

#insert_topObject



334
335
336
337
# File 'lib/ektoplayer/ui.rb', line 334

def insert_top
   move(0, 0)
   insertln
self end

#mv_left(n) ⇒ Object



324
# File 'lib/ektoplayer/ui.rb', line 324

def mv_left(n)       move(cury, curx - 1)                 ;self;end

#next_lineObject



323
# File 'lib/ektoplayer/ui.rb', line 323

def next_line;       move(cury + 1, 0)                    ;self;end

#on_column(n) ⇒ Object



322
# File 'lib/ektoplayer/ui.rb', line 322

def on_column(n)     move(cury, n)                        ;self;end

#on_line(n) ⇒ Object



321
# File 'lib/ektoplayer/ui.rb', line 321

def on_line(n)       move(n, curx)                        ;self;end

#posObject



297
# File 'lib/ektoplayer/ui.rb', line 297

def pos;     UI::Point.new(y: begy, x: begx)           end

#pos=(new) ⇒ Object



304
305
306
# File 'lib/ektoplayer/ui.rb', line 304

def pos=(new)
   mvwin(new.y, new.x)
end

#sizeObject



298
# File 'lib/ektoplayer/ui.rb', line 298

def size;    UI::Size.new(height: maxy, width: maxx)   end

#size=(new) ⇒ Object



308
309
310
# File 'lib/ektoplayer/ui.rb', line 308

def size=(new)
   resize(new.height, new.width) or fail "Could not resize: #{new}"
end

#with_attr(attr) ⇒ Object



312
313
314
# File 'lib/ektoplayer/ui.rb', line 312

def with_attr(attr)
   attron(attr); yield; attroff(attr)
end