Module: Twterm::Tab::Base
- Includes:
- Curses
- Included in:
- KeyAssignmentsCheatsheet, New::List, New::Search, New::Start, New::User, Statuses::Base, UserTab, Users::Base
- Defined in:
- lib/twterm/tab/base.rb
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #close ⇒ Object
- #initialize ⇒ Object
- #refresh ⇒ Object
- #resize ⇒ Object
- #respond_to_key(_) ⇒ Object
Instance Attribute Details
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/twterm/tab/base.rb', line 7 def title @title end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
6 7 8 |
# File 'lib/twterm/tab/base.rb', line 6 def window @window end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 |
# File 'lib/twterm/tab/base.rb', line 9 def ==(other) self.equal?(other) end |
#close ⇒ Object
13 14 15 |
# File 'lib/twterm/tab/base.rb', line 13 def close window.close end |
#initialize ⇒ Object
17 18 19 |
# File 'lib/twterm/tab/base.rb', line 17 def initialize @window = stdscr.subwin(stdscr.maxy - 5, stdscr.maxx, 3, 0) end |
#refresh ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/twterm/tab/base.rb', line 21 def refresh Thread.new do refresh_mutex.synchronize do window.clear # avoid misalignment caused by some multibyte-characters window.with_color(:black, :transparent) do (0...window.maxy).each do |i| window.setpos(i, 0) window.addch(' ') end end update window.refresh end if refreshable? end end |
#resize ⇒ Object
40 41 42 43 |
# File 'lib/twterm/tab/base.rb', line 40 def resize window.resize(stdscr.maxy - 5, stdscr.maxx) window.move(3, 0) end |
#respond_to_key(_) ⇒ Object
45 46 47 |
# File 'lib/twterm/tab/base.rb', line 45 def respond_to_key(_) fail NotImplementedError, 'respond_to_key method must be implemented' end |