Module: Ncurses

Defined in:
lib/ncurses-ruby/version.rb,
ext/ncurses/ncurses_wrap.c,
lib/ncurses.rb,
lib/ncurses.rb

Defined Under Namespace

Modules: Destroy_checker, Form, Menu, Namespace, Panel, Ruby Classes: Exception, MEVENT, SCREEN, WINDOW

Constant Summary collapse

CURSES =
INT2NUM((int)(CURSES))
CURSES_H =
INT2NUM((int)(CURSES_H))
NCURSES_VERSION_MAJOR =
INT2NUM((int)(NCURSES_VERSION_MAJOR))
NCURSES_VERSION_MINOR =
INT2NUM((int)(NCURSES_VERSION_MINOR))
NCURSES_VERSION_PATCH =
INT2NUM((int)(NCURSES_VERSION_PATCH))
NCURSES_VERSION =
rb_str_new2(NCURSES_VERSION)
WA_ATTRIBUTES =
INT2NUM(WA_ATTRIBUTES)
WA_NORMAL =
INT2NUM(WA_NORMAL)
WA_STANDOUT =
INT2NUM(WA_STANDOUT)
WA_UNDERLINE =
INT2NUM(WA_UNDERLINE)
WA_REVERSE =
INT2NUM(WA_REVERSE)
INT2NUM(WA_BLINK)
WA_DIM =
INT2NUM(WA_DIM)
WA_BOLD =
INT2NUM(WA_BOLD)
WA_ALTCHARSET =
INT2NUM(WA_ALTCHARSET)
WA_INVIS =
INT2NUM(WA_INVIS)
WA_PROTECT =
INT2NUM(WA_PROTECT)
WA_HORIZONTAL =
INT2NUM(WA_HORIZONTAL)
WA_LEFT =
INT2NUM(WA_LEFT)
WA_LOW =
INT2NUM(WA_LOW)
WA_RIGHT =
INT2NUM(WA_RIGHT)
WA_TOP =
INT2NUM(WA_TOP)
WA_VERTICAL =
INT2NUM(WA_VERTICAL)
COLOR_BLACK =
INT2NUM(COLOR_BLACK)
COLOR_RED =
INT2NUM(COLOR_RED)
COLOR_GREEN =
INT2NUM(COLOR_GREEN)
COLOR_YELLOW =
INT2NUM(COLOR_YELLOW)
COLOR_BLUE =
INT2NUM(COLOR_BLUE)
COLOR_MAGENTA =
INT2NUM(COLOR_MAGENTA)
COLOR_CYAN =
INT2NUM(COLOR_CYAN)
COLOR_WHITE =
INT2NUM(COLOR_WHITE)
ERR =
INT2NUM(ERR)
OK =
INT2NUM(OK)
SUBWIN =
INT2NUM(_SUBWIN)
ENDLINE =
INT2NUM(_ENDLINE)
FULLWIN =
INT2NUM(_FULLWIN)
SCROLLWIN =
INT2NUM(_SCROLLWIN)
ISPAD =
INT2NUM(_ISPAD)
HASMOVED =
INT2NUM(_HASMOVED)
WRAPPED =
INT2NUM(_WRAPPED)
NOCHANGE =

this value is used in the firstchar and lastchar fields to mark unchanged lines

INT2NUM(_NOCHANGE)
NEWINDEX =

this value is used in the oldindex field to mark lines created by insertions and scrolls.

INT2NUM(_NEWINDEX)
CCHARW_MAX =
INT2NUM(CCHARW_MAX)
A_NORMAL =

attributes

INT2NUM(A_NORMAL)
A_ATTRIBUTES =
INT2NUM(A_ATTRIBUTES)
A_CHARTEXT =
INT2NUM(A_CHARTEXT)
A_COLOR =
INT2NUM(A_COLOR)
A_STANDOUT =
INT2NUM(A_STANDOUT)
A_UNDERLINE =
INT2NUM(A_UNDERLINE)
A_REVERSE =
INT2NUM(A_REVERSE)
INT2NUM(A_BLINK)
A_DIM =
INT2NUM(A_DIM)
A_BOLD =
INT2NUM(A_BOLD)
A_ALTCHARSET =
INT2NUM(A_ALTCHARSET)
A_INVIS =
INT2NUM(A_INVIS)
A_PROTECT =

Tradeoff on 32-bit machines (‘protect’ vs widec). The others (e.g., left highlight are not implemented in any terminal descriptions, anyway.

INT2NUM(A_PROTECT)
A_HORIZONTAL =
INT2NUM(A_HORIZONTAL)
A_LEFT =
INT2NUM(A_LEFT)
A_LOW =
INT2NUM(A_LOW)
A_RIGHT =
INT2NUM(A_RIGHT)
A_TOP =
INT2NUM(A_TOP)
A_VERTICAL =
INT2NUM(A_VERTICAL)
KEY_CODE_YES =
INT2NUM(KEY_CODE_YES)
KEY_MIN =
INT2NUM(KEY_MIN)
KEY_BREAK =
INT2NUM(KEY_BREAK)
KEY_DOWN =
INT2NUM(KEY_DOWN)
KEY_UP =
INT2NUM(KEY_UP)
KEY_LEFT =
INT2NUM(KEY_LEFT)
KEY_RIGHT =
INT2NUM(KEY_RIGHT)
KEY_HOME =
INT2NUM(KEY_HOME)
KEY_BACKSPACE =
INT2NUM(KEY_BACKSPACE)
KEY_F0 =
INT2NUM(KEY_F(0))
KEY_F1 =
INT2NUM(KEY_F(1))
KEY_F2 =
INT2NUM(KEY_F(2))
KEY_F3 =
INT2NUM(KEY_F(3))
KEY_F4 =
INT2NUM(KEY_F(4))
KEY_F5 =
INT2NUM(KEY_F(5))
KEY_F6 =
INT2NUM(KEY_F(6))
KEY_F7 =
INT2NUM(KEY_F(7))
KEY_F8 =
INT2NUM(KEY_F(8))
KEY_F9 =
INT2NUM(KEY_F(9))
KEY_F10 =
INT2NUM(KEY_F(10))
KEY_F11 =
INT2NUM(KEY_F(11))
KEY_F12 =
INT2NUM(KEY_F(12))
KEY_F13 =
INT2NUM(KEY_F(13))
KEY_F14 =
INT2NUM(KEY_F(14))
KEY_F15 =
INT2NUM(KEY_F(15))
KEY_F16 =
INT2NUM(KEY_F(16))
KEY_F17 =
INT2NUM(KEY_F(17))
KEY_F18 =
INT2NUM(KEY_F(18))
KEY_F19 =
INT2NUM(KEY_F(19))
KEY_F20 =
INT2NUM(KEY_F(20))
KEY_F21 =
INT2NUM(KEY_F(21))
KEY_F22 =
INT2NUM(KEY_F(22))
KEY_F23 =
INT2NUM(KEY_F(23))
KEY_F24 =
INT2NUM(KEY_F(24))
KEY_F25 =
INT2NUM(KEY_F(25))
KEY_F26 =
INT2NUM(KEY_F(26))
KEY_F27 =
INT2NUM(KEY_F(27))
KEY_F28 =
INT2NUM(KEY_F(28))
KEY_F29 =
INT2NUM(KEY_F(29))
KEY_F30 =
INT2NUM(KEY_F(30))
KEY_DL =
INT2NUM(KEY_DL)
KEY_IL =
INT2NUM(KEY_IL)
KEY_DC =
INT2NUM(KEY_DC)
KEY_IC =
INT2NUM(KEY_IC)
KEY_EIC =
INT2NUM(KEY_EIC)
KEY_CLEAR =
INT2NUM(KEY_CLEAR)
KEY_EOS =
INT2NUM(KEY_EOS)
KEY_EOL =
INT2NUM(KEY_EOL)
KEY_SF =
INT2NUM(KEY_SF)
KEY_SR =
INT2NUM(KEY_SR)
KEY_NPAGE =
INT2NUM(KEY_NPAGE)
KEY_PPAGE =
INT2NUM(KEY_PPAGE)
KEY_STAB =
INT2NUM(KEY_STAB)
KEY_CTAB =
INT2NUM(KEY_CTAB)
KEY_CATAB =
INT2NUM(KEY_CATAB)
KEY_ENTER =
INT2NUM(KEY_ENTER)
KEY_SRESET =
INT2NUM(KEY_SRESET)
KEY_RESET =
INT2NUM(KEY_RESET)
KEY_PRINT =
INT2NUM(KEY_PRINT)
KEY_LL =
INT2NUM(KEY_LL)
KEY_A1 =

c1 down c3

INT2NUM(KEY_A1)
KEY_A3 =
INT2NUM(KEY_A3)
KEY_B2 =
INT2NUM(KEY_B2)
KEY_C1 =
INT2NUM(KEY_C1)
KEY_C3 =
INT2NUM(KEY_C3)
KEY_BTAB =
INT2NUM(KEY_BTAB)
KEY_BEG =
INT2NUM(KEY_BEG)
KEY_CANCEL =
INT2NUM(KEY_CANCEL)
KEY_CLOSE =
INT2NUM(KEY_CLOSE)
KEY_COMMAND =
INT2NUM(KEY_COMMAND)
KEY_COPY =
INT2NUM(KEY_COPY)
KEY_CREATE =
INT2NUM(KEY_CREATE)
KEY_END =
INT2NUM(KEY_END)
KEY_EXIT =
INT2NUM(KEY_EXIT)
KEY_FIND =
INT2NUM(KEY_FIND)
KEY_HELP =
INT2NUM(KEY_HELP)
KEY_MARK =
INT2NUM(KEY_MARK)
KEY_MESSAGE =
INT2NUM(KEY_MESSAGE)
KEY_MOVE =
INT2NUM(KEY_MOVE)
KEY_NEXT =
INT2NUM(KEY_NEXT)
KEY_OPEN =
INT2NUM(KEY_OPEN)
KEY_OPTIONS =
INT2NUM(KEY_OPTIONS)
KEY_PREVIOUS =
INT2NUM(KEY_PREVIOUS)
KEY_REDO =
INT2NUM(KEY_REDO)
KEY_REFERENCE =
INT2NUM(KEY_REFERENCE)
KEY_REFRESH =
INT2NUM(KEY_REFRESH)
KEY_REPLACE =
INT2NUM(KEY_REPLACE)
KEY_RESTART =
INT2NUM(KEY_RESTART)
KEY_RESUME =
INT2NUM(KEY_RESUME)
KEY_SAVE =
INT2NUM(KEY_SAVE)
KEY_SBEG =
INT2NUM(KEY_SBEG)
KEY_SCANCEL =
INT2NUM(KEY_SCANCEL)
KEY_SCOMMAND =
INT2NUM(KEY_SCOMMAND)
KEY_SCOPY =
INT2NUM(KEY_SCOPY)
KEY_SCREATE =
INT2NUM(KEY_SCREATE)
KEY_SDC =
INT2NUM(KEY_SDC)
KEY_SDL =
INT2NUM(KEY_SDL)
KEY_SELECT =
INT2NUM(KEY_SELECT)
KEY_SEND =
INT2NUM(KEY_SEND)
KEY_SEOL =
INT2NUM(KEY_SEOL)
KEY_SEXIT =
INT2NUM(KEY_SEXIT)
KEY_SFIND =
INT2NUM(KEY_SFIND)
KEY_SHELP =
INT2NUM(KEY_SHELP)
KEY_SHOME =
INT2NUM(KEY_SHOME)
KEY_SIC =
INT2NUM(KEY_SIC)
KEY_SLEFT =
INT2NUM(KEY_SLEFT)
KEY_SMESSAGE =
INT2NUM(KEY_SMESSAGE)
KEY_SMOVE =
INT2NUM(KEY_SMOVE)
KEY_SNEXT =
INT2NUM(KEY_SNEXT)
KEY_SOPTIONS =
INT2NUM(KEY_SOPTIONS)
KEY_SPREVIOUS =
INT2NUM(KEY_SPREVIOUS)
KEY_SPRINT =
INT2NUM(KEY_SPRINT)
KEY_SREDO =
INT2NUM(KEY_SREDO)
KEY_SREPLACE =
INT2NUM(KEY_SREPLACE)
KEY_SRIGHT =
INT2NUM(KEY_SRIGHT)
KEY_SRSUME =
INT2NUM(KEY_SRSUME)
KEY_SSAVE =
INT2NUM(KEY_SSAVE)
KEY_SSUSPEND =
INT2NUM(KEY_SSUSPEND)
KEY_SUNDO =
INT2NUM(KEY_SUNDO)
KEY_SUSPEND =
INT2NUM(KEY_SUSPEND)
KEY_UNDO =
INT2NUM(KEY_UNDO)
KEY_MOUSE =
INT2NUM(KEY_MOUSE)
KEY_RESIZE =
INT2NUM(KEY_RESIZE)
KEY_MAX =
INT2NUM(KEY_MAX)
BUTTON1_RELEASED =

event masks

INT2NUM(BUTTON1_RELEASED)
BUTTON1_PRESSED =
INT2NUM(BUTTON1_PRESSED)
BUTTON1_CLICKED =
INT2NUM(BUTTON1_CLICKED)
BUTTON1_DOUBLE_CLICKED =
INT2NUM(BUTTON1_DOUBLE_CLICKED)
BUTTON1_TRIPLE_CLICKED =
INT2NUM(BUTTON1_TRIPLE_CLICKED)
BUTTON1_RESERVED_EVENT =
INT2NUM(BUTTON1_RESERVED_EVENT)
BUTTON2_RELEASED =
INT2NUM(BUTTON2_RELEASED)
BUTTON2_PRESSED =
INT2NUM(BUTTON2_PRESSED)
BUTTON2_CLICKED =
INT2NUM(BUTTON2_CLICKED)
BUTTON2_DOUBLE_CLICKED =
INT2NUM(BUTTON2_DOUBLE_CLICKED)
BUTTON2_TRIPLE_CLICKED =
INT2NUM(BUTTON2_TRIPLE_CLICKED)
BUTTON2_RESERVED_EVENT =
INT2NUM(BUTTON2_RESERVED_EVENT)
BUTTON3_RELEASED =
INT2NUM(BUTTON3_RELEASED)
BUTTON3_PRESSED =
INT2NUM(BUTTON3_PRESSED)
BUTTON3_CLICKED =
INT2NUM(BUTTON3_CLICKED)
BUTTON3_DOUBLE_CLICKED =
INT2NUM(BUTTON3_DOUBLE_CLICKED)
BUTTON3_TRIPLE_CLICKED =
INT2NUM(BUTTON3_TRIPLE_CLICKED)
BUTTON3_RESERVED_EVENT =
INT2NUM(BUTTON3_RESERVED_EVENT)
BUTTON4_RELEASED =
INT2NUM(BUTTON4_RELEASED)
BUTTON4_PRESSED =
INT2NUM(BUTTON4_PRESSED)
BUTTON4_CLICKED =
INT2NUM(BUTTON4_CLICKED)
BUTTON4_DOUBLE_CLICKED =
INT2NUM(BUTTON4_DOUBLE_CLICKED)
BUTTON4_TRIPLE_CLICKED =
INT2NUM(BUTTON4_TRIPLE_CLICKED)
BUTTON4_RESERVED_EVENT =
INT2NUM(BUTTON4_RESERVED_EVENT)
BUTTON_CTRL =
INT2NUM(BUTTON_CONTROL)
BUTTON_SHIFT =
INT2NUM(BUTTON_SHIFT)
BUTTON_ALT =
INT2NUM(BUTTON_ALT)
ALL_MOUSE_EVENTS =
INT2NUM(ALL_MOUSE_EVENTS)
REPORT_MOUSE_POSITION =
INT2NUM(REPORT_MOUSE_POSITION)
TRACE_DISABLE =
INT2NUM(TRACE_DISABLE)
TRACE_TIMES =
INT2NUM(TRACE_TIMES)
TRACE_TPUTS =
INT2NUM(TRACE_TPUTS)
TRACE_UPDATE =
INT2NUM(TRACE_UPDATE)
TRACE_MOVE =
INT2NUM(TRACE_MOVE)
TRACE_CHARPUT =
INT2NUM(TRACE_CHARPUT)
TRACE_ORDINARY =
INT2NUM(TRACE_ORDINARY)
TRACE_CALLS =
INT2NUM(TRACE_CALLS)
TRACE_VIRTPUT =
INT2NUM(TRACE_VIRTPUT)
TRACE_IEVENT =
INT2NUM(TRACE_IEVENT)
TRACE_BITS =
INT2NUM(TRACE_BITS)
TRACE_ICALLS =
INT2NUM(TRACE_ICALLS)
TRACE_CCALLS =
INT2NUM(TRACE_CCALLS)
TRACE_MAXIMUM =
INT2NUM(TRACE_MAXIMUM)
GETSTR_LIMIT =
1024
Ncurses =

for accessing Ncurses from a Module that includes Ncurses

self

Class Method Summary collapse

Class Method Details

._ENDLINEObject



32
33
34
# File 'lib/ncurses.rb', line 32

def Ncurses._ENDLINE 
  Ncurses::ENDLINE
end

._FULLWINObject



35
36
37
# File 'lib/ncurses.rb', line 35

def Ncurses._FULLWIN 
  Ncurses::FULLWIN
end

._HASMOVEDObject



44
45
46
# File 'lib/ncurses.rb', line 44

def Ncurses._HASMOVED
  Ncurses::HASMOVED
end

._ISPADObject



41
42
43
# File 'lib/ncurses.rb', line 41

def Ncurses._ISPAD   
  Ncurses::ISPAD
end

._NEWINDEXObject



53
54
55
# File 'lib/ncurses.rb', line 53

def Ncurses._NEWINDEX
  Ncurses::NEWINDEX
end

._NOCHANGEObject



50
51
52
# File 'lib/ncurses.rb', line 50

def Ncurses._NOCHANGE
  Ncurses::NOCHANGE
end

._SCROLLWINObject



38
39
40
# File 'lib/ncurses.rb', line 38

def Ncurses._SCROLLWIN
  Ncurses::SCROLLWIN
end

._SUBWINObject



29
30
31
# File 'lib/ncurses.rb', line 29

def Ncurses._SUBWIN  
  Ncurses::SUBWIN
end

._WRAPPEDObject



47
48
49
# File 'lib/ncurses.rb', line 47

def Ncurses._WRAPPED 
  Ncurses::WRAPPED
end

._XOPEN_CURSESObject

Ncurses constants with leading underscore



26
27
28
# File 'lib/ncurses.rb', line 26

def Ncurses._XOPEN_CURSES
  Ncurses::XOPEN_CURSES
end

.eraseObject



253
254
255
# File 'lib/ncurses.rb', line 253

def Ncurses.erase
  Ncurses.werase(Ncurses.stdscr)
end

.getbegx(win) ⇒ Object



235
236
237
# File 'lib/ncurses.rb', line 235

def Ncurses.getbegx(win)
  x = []; y = []; Ncurses.getbegyx(win, y,x); x[0]
end

.getbegy(win) ⇒ Object



238
239
240
# File 'lib/ncurses.rb', line 238

def Ncurses.getbegy(win)
  x = []; y = []; Ncurses.getbegyx(win, y,x); y[0]
end

.getcurx(win) ⇒ Object



229
230
231
# File 'lib/ncurses.rb', line 229

def Ncurses.getcurx(win)
  x = []; y = []; Ncurses.getyx(win, y,x); x[0]
end

.getcury(win) ⇒ Object



232
233
234
# File 'lib/ncurses.rb', line 232

def Ncurses.getcury(win)
  x = []; y = []; Ncurses.getyx(win, y,x); y[0]
end

.getmaxx(win) ⇒ Object



241
242
243
# File 'lib/ncurses.rb', line 241

def Ncurses.getmaxx(win)
  x = []; y = []; Ncurses.getmaxyx(win, y,x); x[0]
end

.getmaxy(win) ⇒ Object



244
245
246
# File 'lib/ncurses.rb', line 244

def Ncurses.getmaxy(win)
  x = []; y = []; Ncurses.getmaxyx(win, y,x); y[0]
end

.getnstr(str, n) ⇒ Object



181
182
183
# File 'lib/ncurses.rb', line 181

def Ncurses.getnstr(str,n)
  Ncurses.wgetnstr(Ncurses.stdscr, str, n)
end

.getparx(win) ⇒ Object



247
248
249
# File 'lib/ncurses.rb', line 247

def Ncurses.getparx(win)
  x = []; y = []; Ncurses.getparyx(win, y,x); x[0]
end

.getpary(win) ⇒ Object



250
251
252
# File 'lib/ncurses.rb', line 250

def Ncurses.getpary(win)
  x = []; y = []; Ncurses.getparyx(win, y,x); y[0]
end

.getstr(str) ⇒ Object



256
257
258
# File 'lib/ncurses.rb', line 256

def Ncurses.getstr(str)
  Ncurses.getnstr(str, Ncurses::GETSTR_LIMIT)
end

.inchnstr(str, n) ⇒ Object



151
152
153
# File 'lib/ncurses.rb', line 151

def Ncurses.inchnstr(str,n)
  Ncurses.winchnstr(Ncurses.stdscr, str, n)
end

.inchstr(str) ⇒ Object



154
155
156
# File 'lib/ncurses.rb', line 154

def Ncurses.inchstr(str)
  Ncurses.winchstr(Ncurses.stdscr, str)
end

.innstr(str, n) ⇒ Object



195
196
197
# File 'lib/ncurses.rb', line 195

def Ncurses.innstr(str,n)
  Ncurses.winnstr(Ncurses.stdscr, str, n)
end

.instr(str) ⇒ Object



198
199
200
# File 'lib/ncurses.rb', line 198

def Ncurses.instr(str)
  Ncurses.winstr(Ncurses.stdscr, str)
end

.mouse_trafo(pY, pX, to_screen) ⇒ Object



225
226
227
# File 'lib/ncurses.rb', line 225

def Ncurses.mouse_trafo(pY, pX, to_screen)
  Ncurses.wmouse_trafo(Ncurses.stdscr, pY, pX, to_screen)
end

.mvgetnstr(y, x, str, n) ⇒ Object



184
185
186
# File 'lib/ncurses.rb', line 184

def Ncurses.mvgetnstr(y,x, str, n)
  Ncurses.mvwgetnstr(Ncurses.stdscr, y,x, str, n)
end

.mvgetstr(y, x, str) ⇒ Object



259
260
261
# File 'lib/ncurses.rb', line 259

def Ncurses.mvgetstr(y,x, str)
  Ncurses.mvgetnstr(y,x, str, Ncurses::GETSTR_LIMIT)
end

.mvinchnstr(y, x, str, n) ⇒ Object



157
158
159
# File 'lib/ncurses.rb', line 157

def Ncurses.mvinchnstr(y,x, str, n)
  Ncurses.mvwinchnstr(Ncurses.stdscr, y,x, str, n)
end

.mvinchstr(y, x, str) ⇒ Object



160
161
162
# File 'lib/ncurses.rb', line 160

def Ncurses.mvinchstr(y,x, str)
  Ncurses.mvwinchstr(Ncurses.stdscr, y,x, str)
end

.mvinnstr(y, x, str, n) ⇒ Object



201
202
203
# File 'lib/ncurses.rb', line 201

def Ncurses.mvinnstr(y,x, str, n)
  Ncurses.mvwinnstr(Ncurses.stdscr, y,x, str, n)
end

.mvinstr(y, x, str) ⇒ Object



204
205
206
# File 'lib/ncurses.rb', line 204

def Ncurses.mvinstr(y,x, str)
  Ncurses.mvwinstr(Ncurses.stdscr, y,x, str)
end

.mvprintw(*args) ⇒ Object



292
293
294
# File 'lib/ncurses.rb', line 292

def Ncurses.mvprintw(*args)
  Ncurses.mvwprintw(Ncurses.stdscr, *args)
end

.mvscanw(y, x, format, result) ⇒ Object



272
273
274
# File 'lib/ncurses.rb', line 272

def Ncurses.mvscanw(y,x, format, result)
  Ncurses.mvwscanw(Ncurses.stdscr, y,x, format, result)
end

.mvwgetnstr(win, y, x, str, n) ⇒ Object



187
188
189
190
191
192
193
# File 'lib/ncurses.rb', line 187

def Ncurses.mvwgetnstr(win, y,x, str, n)
  if (Ncurses.wmove(win,y,x) == Ncurses::ERR) 
    Ncurses::ERR
  else
    Ncurses.wgetnstr(win,str,n)
  end
end

.mvwgetstr(win, y, x, str) ⇒ Object



262
263
264
# File 'lib/ncurses.rb', line 262

def Ncurses.mvwgetstr(win, y,x, str)
  Ncurses.mvwgetnstr(win, y,x, str, Ncurses::GETSTR_LIMIT)
end

.mvwinchnstr(win, y, x, str, n) ⇒ Object



163
164
165
166
167
168
169
# File 'lib/ncurses.rb', line 163

def Ncurses.mvwinchnstr(win, y,x, str, n)
  if (Ncurses.wmove(win,y,x) == Ncurses::ERR) 
    Ncurses::ERR
  else
    Ncurses.winchnstr(win,str,n)
  end
end

.mvwinchstr(win, y, x, str) ⇒ Object



170
171
172
173
174
# File 'lib/ncurses.rb', line 170

def Ncurses.mvwinchstr(win, y,x, str)
  maxy = []; maxx = []; getmaxyx(win, maxy,maxx)
  return Ncurses::ERR if (maxx[0] == Ncurses::ERR)
  Ncurses.mvwinchnstr(win, y,x, str, maxx[0]+1)
end

.mvwinnstr(win, y, x, str, n) ⇒ Object



207
208
209
210
211
212
213
# File 'lib/ncurses.rb', line 207

def Ncurses.mvwinnstr(win, y,x, str, n)
  if (Ncurses.wmove(win,y,x) == Ncurses::ERR) 
    Ncurses::ERR
  else
    Ncurses.winnstr(win,str,n)
  end
end

.mvwinstr(win, y, x, str) ⇒ Object



214
215
216
217
218
# File 'lib/ncurses.rb', line 214

def Ncurses.mvwinstr(win, y,x, str)
  maxy = []; maxx = []; getmaxyx(win, maxy,maxx)
  return Ncurses::ERR if (maxx[0] == Ncurses::ERR)
  Ncurses.mvwinnstr(win, y,x, str, maxx[0]+1)
end

.mvwprintw(win, y, x, *args) ⇒ Object



295
296
297
298
299
300
301
# File 'lib/ncurses.rb', line 295

def Ncurses.mvwprintw(win, y,x, *args)
  if (Ncurses.wmove(win,y,x) == Ncurses::ERR) 
    Ncurses::ERR
  else
    wprintw(win, *args)
  end
end

.mvwscanw(win, y, x, format, result) ⇒ Object



275
276
277
278
279
280
281
# File 'lib/ncurses.rb', line 275

def Ncurses.mvwscanw(win, y,x, format, result)
  if (Ncurses.wmove(win, y,x) == Ncurses::ERR) 
    Ncurses::ERR
  else
    Ncurses.wscanw(win, format, result)
  end
end

.printw(*args) ⇒ Object



302
303
304
# File 'lib/ncurses.rb', line 302

def Ncurses.printw(*args)
  Ncurses.wprintw(Ncurses.stdscr, *args)
end

.scanw(format, result) ⇒ Object



269
270
271
# File 'lib/ncurses.rb', line 269

def Ncurses.scanw(format, result)
  Ncurses.wscanw(Ncurses.stdscr, format, result)
end

.touchline(win, start, count) ⇒ Object



305
306
307
# File 'lib/ncurses.rb', line 305

def Ncurses.touchline(win, start, count)
  Ncurses.wtouchln(win, start, count, 1)
end

.touchwin(win) ⇒ Object



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

def Ncurses.touchwin(win)
  wtouchln(win, 0, getmaxy(win), 1)
end

.wgetstr(win, str) ⇒ Object



265
266
267
# File 'lib/ncurses.rb', line 265

def Ncurses.wgetstr(win, str)
  Ncurses.wgetnstr(win, str, Ncurses::GETSTR_LIMIT)
end

.winchstr(win, str) ⇒ Object



175
176
177
178
179
# File 'lib/ncurses.rb', line 175

def Ncurses.winchstr(win, str)
  maxy = []; maxx = []; getmaxyx(win, maxy,maxx)
  return Ncurses::ERR if (maxx[0] == Ncurses::ERR)
  Ncurses.winchnstr(win, str, maxx[0]+1)
end

.winstr(win, str) ⇒ Object



219
220
221
222
223
# File 'lib/ncurses.rb', line 219

def Ncurses.winstr(win, str)
  maxy = []; maxx = []; getmaxyx(win, maxy,maxx)
  return Ncurses::ERR if (maxx[0] == Ncurses::ERR)
  Ncurses.winnstr(win, str, maxx[0]+1)
end

.wscanw(win, format, result) ⇒ Object



282
283
284
285
286
287
288
289
290
# File 'lib/ncurses.rb', line 282

def Ncurses.wscanw(win, format, result)
  str = ""
  if (Ncurses.wgetstr(win, str) == Ncurses::ERR) 
    Ncurses::ERR
  else
    require "scanf.rb" # Use ruby's implementation of scanf
    result.replace(str.scanf(format))
  end
end