Class: Twterm::FilterQueryWindow

Inherits:
Object
  • Object
show all
Includes:
Curses, Singleton
Defined in:
lib/twterm/filter_query_window.rb

Instance Method Summary collapse

Constructor Details

#initializeFilterQueryWindow

Returns a new instance of FilterQueryWindow.



6
7
8
# File 'lib/twterm/filter_query_window.rb', line 6

def initialize
  @window = stdscr.subwin(1, stdscr.maxx, stdscr.maxy - 1, 0)
end

Instance Method Details

#clearObject



23
24
25
26
# File 'lib/twterm/filter_query_window.rb', line 23

def clear
  stdscr.setpos(stdscr.maxy - 1, 0)
  stdscr.addstr(' ' * window.maxx)
end

#inputObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/twterm/filter_query_window.rb', line 10

def input
  clear

  echo
  stdscr.setpos(stdscr.maxy - 1, 0)
  stdscr.addch '/'

  query = getstr.chomp
  noecho

  query || ''
end