|
|
|
|
SSL chap2.html
Interaktion und PortierbarkeitHTML
|
|
| products/Sources/formale Sprachen/GAP/pkg/browse/doc/chap2.html |
 |
<? xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns= "http://www.w3.org/1999/xhtml" xml:lang= "en">
<head>
<title>GAP (Browse) - Chapter 2: Interface to the ncurses Library</title>
<meta http-equiv= "content-type" content= "text/html; charset=UTF-8" />
<meta name= "generator" content= "GAPDoc2HTML" />
<link rel= "stylesheet" type= "text/css" href= "manual.css" />
< script src= "manual.js" type= "text/javascript"></ script>
< script type= "text/javascript">overwriteStyle();</ script>
</head>
<body class= "chap2" onload= "jscontent()">
<div class= "chlinktop"><span class= "chlink1">Goto Chapter: </span><a href= "chap0.html">Top</a> <a href= "chap1.html"> 1</a> <a href= "chap2.html"> 2</a> <a href= "chap3.html"> 3</a> <a href= "chap4.html"> 4< /a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chapA.html">A</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap1.html">[Previous Chapter]</a> <a href="chap3.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap2_mj.html">[MathJax on]</a></p>
<p><a id="X7E049B1185A56B30" name="X7E049B1185A56B30"></a></p>
<div class="ChapSects"><a href="chap2.html#X7E049B1185A56B30">2 <span class="Heading">Interface to the <code class="code">ncurses</code> Library</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X85DE9B75837BA65B">2.1 <span class="Heading">The <code class="code">ncurses</code> Library</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X8499A3A384BF1F2D">2.1-1 <span class="Heading">Setting the terminal</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X800D5B6381F0356F">2.1-2 <span class="Heading">Manipulating windows</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X7D541BDE7BB8BED5">2.1-3 <span class="Heading">Manipulating panels</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X7F23F5F48650A78B">2.1-4 <span class="Heading">Getting keyboard input</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X7FD4E558816B3146">2.1-5 <span class="Heading">Writing to windows</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X8091936586CCD248">2.1-6 <span class="Heading">Line drawing characters</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X793D897483674294">2.1-7 <span class="Heading">Text attributes and colors</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X86675F5F791FEFEF">2.1-8 <span class="Heading">Low level <code class="code">ncurses</code> mouse support</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X83897BF984211EFD">2.1-9 <span class="Heading">Miscellaneous function</span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X864A5C1C7F181B4B">2.2 <span class="Heading">The <code class="code">ncurses</code> <strong class="pkg">GAP</strong>
functions</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X83ADB4E37C105B8C">2.2-1 NCurses.ColorAttr</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X879D81B37A0A4E8F">2.2-2 NCurses.SetTerm</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X81D1FC927C455AEB">2.2-3 NCurses.IsAttributeLine</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X8372F0C57816A29E">2.2-4 NCurses.ConcatenationAttributeLines</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X7D2EB0BF82C4F25C">2.2-5 NCurses.RepeatedAttributeLine</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X83FFD5047ADE716E">2.2-6 NCurses.PutLine</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X82C53ACD805EE0C3">2.2-7 NCurses.WidthAttributeLine</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X790715F683BF1E66">2.2-8 NCurses.Grid</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X82B801587B37D571">2.2-9 NCurses.WBorder</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X799C033A7AB582D7">2.2-10 <span class="Heading">Mouse support in <code class="code">ncurses</code> applications</span></a>
</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap2.html#X85FB1D7878A322EB">2.2-11 NCurses.SaveWin</a></span>
</div></div>
</div>
<h3>2 <span class="Heading">Interface to the <code class="code">ncurses</code> Library</span></h3>
<p>In this chapter we describe the <strong class="pkg">GAP</strong> interface to the <strong class="pkg">GNU</strong> <code class="code">curses</code>/<code class="code">ncurses</code> <code class="code">C</code>-library. This library contains routines to manipulate the contents of terminal windows. It allows one to write programs which should work on a wide variety of terminal emulations with different sets of capabilities.</p>
<p>This technical chapter is intended for readers who want to program new applications using the <code class="code">ncurses</code> functionality. If you are only interested in the function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) from this package or some of its applications you can skip this chapter.</p>
<p>Detailed documentation of the <code class="code">ncurses</code> library is probably available in your operating system (try <code class="code">man ncurses</code>) and from the web (see for example <a href="chapBib.html#biBNCursesWeb">[NCu]</a>). Here, we only give short reminders about the functions provided in the <strong class="pkg">GAP</strong> interface and explain how to use the <strong class="pkg">GAP</strong> functions.</p>
<p><a id="X85DE9B75837BA65B" name="X85DE9B75837BA65B"></a></p>
<h4>2.1 <span class="Heading">The <code class="code">ncurses</code> Library</span></h4>
<p>In this section we list the functions from the GNU <code class="code">ncurses</code> library and its <code class="code">panel</code> extension which are made available in <strong class="pkg">GAP</strong> via the <strong class="pkg">Browse</strong> package. See the following section <a href="chap2.html#X864A5C1C7F181B4B"><span class="RefLink">2.2</span></a> for explanations how to use these functions from within <strong class="pkg">GAP</strong>.</p>
<p>The basic objects to manipulate are called <em>windows</em>, they correspond to rectangular regions of the terminal screen. Windows can overlap but <code class="code">ncurses</code> cannot handle this for the display. Therefore windows can be wrapped in <em>panels</em>, they provide a display depth for windows and it is possible to move panels to the top and bottom of the display or to hide a panel.</p>
<p>We will not import all the functions of the <code class="code">ncurses</code> library to <strong class="pkg">GAP</strong>. For example, there are many pairs of functions with the same name except for a leading <code class="code">w</code> (like <code class="code">move</code> and <code class="code">wmove</code> for moving the cursor in a window). Here, we only import the versions with <code class="code">w</code>, which get a window as first argument. The functions without <code class="code">w</code> are for the <code class="code">ncurses</code> standard screen window <code class="code">stdscr</code> which is available as window <code class="code">0</code> in <strong class="pkg">GAP</strong>. Similarly, there are functions with the same name except for an extra <code class="code">n</code> (like <code class="code">waddstr</code> and <code class="code">waddnstr</code> for placing a string into a window). Here, we only import the functions with <code class="code">n</code> which get the number of characters to write as argument. (More convenient functions are then implemented on the <strong class="pkg">GAP</strong> level.)</p>
<&java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 134
<h5>2.1-1 <span class="Heading">Setting the/pan
<p>We first list flags /div<div>
<dl>
<dt><strong class="Mark"><code class="code">savetty()</code></strong></dt>
<dd><div>
</dd>
<dt><strong class="Mark"><code class="code">resetty()</code></strong></dt>
<dd>p>his java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 109
<>
<<java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<dd><p>In <code class="
pjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 409
<<java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 82
<dd><p>If set to <code class="keyw">true</code> some special input like java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
</dd>
<dt><strong class="Mark">
<code class="code">echo()</code>/<code class="code">noecho()</code></strong></dt>
<<Thisdetermines ifinput characters are automatically echoed by the terminal at the current cursor position.</p>
</dd>5>21- span "Heading"S </<h5>
<< "Mark">< class">()</ode<strong>/java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
<dd><p>This dd><p>This stores the setting of in a./>
</dd>
<dt><strong class="Mark"><code class="code">wtimeout(win, delay)</code></dd<>resets to java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 109
<<code class=code")/)/>/strong>dt>
</dd>
<dt<t>strong ="Mark ahref=chap2.tmlX7F23F5F48650A78B<class=RefLink">2.1-4</<a.( <java.lang.StringIndexOutOfBoundsException: Range [304, 303) out of bounds for length 354
<code class="code">nl()</code>/<code class="code">nonl()
<<With code class="code">nl</code> a return on input is translated to a newline character and a newline on output is java.lang.StringIndexOutOfBoundsException: Index 133 out of bounds for length 81
</dd>
<dt><strong class="Mark"><code class="code">intrflush(win, java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 0
<dd><p>dd<pThisjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 235
</dd>
<dt><strong class
<dd><p>Withdt>sclass=Mark"<class="ode"wtimeoutwin, </>/java.lang.StringIndexOutOfBoundsException: Range [84, 79) out of bounds for length 85
</dd>
<dt></dd
dd>pIfsetto<codeclass=keyw">true</code> moving the cursor down from the last line of a window causes scrolling of the whole window, otherwise nothing happens.</p>
</dd>
<>strong class"><odeclass=ode>leaveok(inbool)</ode</java.lang.StringIndexOutOfBoundsException: Range [78, 77) out of bounds for length 83
<>> to<code ">/code refresh of thewindow thecursoratits current location, otherwisethis s not .="code">idlok(win, bool)</code></strong></dt>
</dd>
<dt><strong class="Mark"><code class="code">clearok(win, bool)</code></strong></dt>
<dd><p>If set to <code class="keyw">true</code> the next refresh of the window will clear the screen completely and redraw everything.</p>
</dd>
<dt><strong class="Mark"><code class="code">immedok(win, bool)</code></strong></dt>
<dd><p>If set to <code class="keyw">true</code> all changes of the window will automatically also call a <code class="code">wrefresh</code>.</p>
</dd>
<dt><strong class="Mark">
<code class="code">raw()</code>/<code class="code">noraw()</code></strong></dt>
<dd><p>Similar to <code class="code">cbreak</code>, usually not needed (see the <code class="code">ncurses</code> documentation for details).</p>
</dd>
</dl>
<p><a id="X800D5B6381F0356F" name="X800D5B6381F0356F"></a></p>
<h5>2.1-2 <span class="Heading">Manipulating windows</span></h5>
<p>In <code class="code">ncurses</code> an arbitrary number of windows which correspond to rectangular regions (maybe overlapping) of the screen can be handled. You should always delete windows which are no longer needed. To get a proper display of overlapping windows (which may occur by recursively called functions using this library) we suggest that you always wrap windows in panels, see <a href="chap2.html#X7D541BDE7BB8BED5"><span class="RefLink">2.1-3</span></a>.</p>
<p>For functions which involve coordinates recall that the upper left corner of the screen or internally of any window has the coordinates (0,0).</p>
<dl>
<dt><strong class="Mark"><code class="code">newwin(nlines, ncols, y, x)</code></strong></dt>
<dd><p>This creates a new window whose upper left corner has the coordinates (<var class="Arg">y</var>,<var class="Arg">x</var>) on the screen and has <var class="Arg">nlines</var> lines and <var class="Arg">ncols</var> columns, if this is possible. The arguments <var class="Arg">nlines</var> and <var class="Arg">ncols</var> can be zero, then their maximal possible values are assumed.</p>
</dd>
<dt><strong class="Mark"><code class="code">delwin(win)</code></strong></dt>
<dd><p>Deletes a window.</p>
</dd>
<dt><strong class="Mark"><code class="code">mvwin(win, y, x)</code></strong></dt>
<dd><p>Moves the upper left corner of the window to the given coordinates, if the window still fits on the screen. With panels don't use this function, but use <code class="code">move_panel</code> mentioned below.</p>
</dd>
<dt><strong class="Mark"><code class="code">wrefresh(win)</code></strong></dt>
<dd><p>Writing to a window only changes some internal buffers, this function copies the window content to the actual display screen. You don't need this function if you wrap your windows in panels, use <code class="code">update_panels</code> and <code class="code">doupdate</code> instead.</p>
</dd>
<dt><strong class="Mark"><code class="code">doupdate()</code></strong></dt>
<dd><p>Use this function to update the content of your display screen to the current content of all windows. If your terminal is not yet in visual mode this function changes to visual mode.</p>
</dd>
<dt><strong class="Mark"><code class="code">endwin()</code></strong></dt>
<dd><p>Use this function to leave the visual mode of your terminal. (Remark: If you use this function while not in visual mode the cursor will be moved to the line where the visual mode was started last time. To avoid this use <code class="code">isendwin</code> first.)</p>
</dd>
<dt><strong class="Mark"><code class="code">isendwin()</code></strong></dt>
<dd><p>Returns <code class="keyw">true</code> if called while not in visual mode and <code class="keyw">false</code> otherwise</p>
</dd>
<dt><strong class="Mark"><code class="code">getbegyx(win)</code></strong></dt>
<dd><p>Get the coordinates of the upper left corner of a window on the screen.</p>
</dd>
<dt><strong class="Mark"><code class="code">getmaxyx(win)</code></strong></dt>
<dd><p>Get the number of lines and columns <dd><p>ith<code class"eyw"true<code the library tries use
</dd>
</dl>
<p><a id="X7D541BDE7BB8BED5" name="X7D541BDE7BB8BED5"></a></p>
<h5>2.1dt<strong class="ark">
<pdd<p> code class=code">cbreak<code> usually ( code class=code"ncurses>documentation details)<p>
<>
<dt><strong java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<dd><p>Create a panel for a window.</p>
</dd>
<dt><java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 0
<><Delete a panel.</>
<dd
dt<class="ark"<codeclass="ode"update_panels</</>/>
<<> of windows and panels to a screen buffer. Then call <code class="code">doupdate()</code> to update the display screen.</p>
</dd>
<dt><strong class="Mark"><code class="code">move_panel(pan, y, x)</code></strong></dt>
<dd><p>Move top left corner of a panel wrapped window to coordinates (<var class="Arg">y</var>,<var class="Arg">x</var>) if possible.</p>
</dd>
<dt><strong class="Mark">
<code class="code">hide_panel(pan)</code>/<code class="code">show_panel(pan)</code></strong></dt>
<dd><p>Hide or show, respectively, the content of a panel on the display screen.</p>
</dd>
<dt><strong class="Mark">
<code class="code">top_panel(pan)</code>/<code class="code">bottom_panel(pan)</code></strong></dt>
<dd><p>Move a panel to the top or bottom of all panels, respectively.</p>
</dd>
<dt><strong class="Mark">
<code class="code">panel_below(pan)</code>/<code class="code">panel_above(pan)</code></strong></dt>
<dd><p>Return the panel directly below or above the given one, respectively. With argument <code class="code">0</code> the top or bottom panel are returned, respectively. If argument is the bottom or top panel, respectively, then <code class="keyw">false</code> is returned.</p>
</dd>
</dl>
<p><a id="X7F23F5F48650A78B" name="X7F23F5F48650A78B"></a></p>
<h5>2.1-4 <span class="Heading">Getting keyboard input</span></h5>
<p>If you want to read input from the user first adjust the terminal settings of <code class="code">cbreak</code>, <code class="code">keypad</code>, <code class="code">echo</code>, <code class="code">wtimeout</code> and <code class="code">curs_set</code> to your needs, see <a href="chap2.html#X8499A3A384BF1F2D"><span class="RefLink">2.1-1</span></a>. The basic functions are as follows.</p>
<dl>
<dt><strong class="Mark"><code class="code">wgetch(win)</code></strong></dt>
<dd><p>Reads one character from user input (returned as integer). If <code class="code">wtimeout</code> was set with a positive <var class="Arg">delay</var> then the function returns <code class="keyw">false</code> if there was no input for <var class="Arg">delay</var> milliseconds. Note that in <code class="code">nocbreak</code> mode typed characters reach the application only after typing a return. If the <code class="code">keypad</code> flag is set to <code class="keyw">true</code> some special keys can be read like single characters; the keys are explained below. (Note that there is only one input queue for all windows.)</p>
</dd>
<dt><strong class="Mark"><code class="code">ungetch(char)</code></strong></dt>
<dd><p>Puts back the character <var class="Arg">char</var> on the input queue.</p>
</dd>
</dl>
<p>Some java.lang.StringIndexOutOfBoundsException: Range [48, 17) out of bounds for length 278
<dl>
<dt><strong class="Mark"><code class="code">UP</code>/<code class="code">DOWN</code>/<code class="code">LEFT</code>/<code class="code">RIGHT</code></strong></dt>
<dd><p>the arrow keys</p>
</dd>
<dt><strong class="Mark"><code class="code">PPAGE</code>/<code class="code">NPAGE</code></strong></dt>
<dd><p>the page up and page down keys</p>
</dd>
<dt><strong class="Mark"><code class="code">HOME</code>/<code class="code">END</code></strong></dt>
<dd><p>the home and end keys</p>
</dd>
<dt><strong class="Mark"><code class="code">BACKSPACE</code>/<code class="code">DC</code></strong></dt>
<dd><p>the backspace and delete keys</p>
<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<dtstrongclass=Mark>code class=code"></java.lang.StringIndexOutOfBoundsException: Range [66, 52) out of bounds for length 67
<dd><p>the insert key</p>
</dd>
<dt><strong class="Mark"><code class="code">java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 0
<dd><p></java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
</dd>
<dtp>a id" name=X8537FEB07AF2BEC8<a><p>
<dd><p>functionkeys<p
</dddiv"ContSect"><spanclass=tocline"< ""&bsp<span ="
<<class"ark">code class=code>/code>/trong>/>
<> key todetectmouse events/p>
<//divjava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
<dt><strong class="Mark"><code class=div class=java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 168
<dd><p>the keys around the arrow keys on a num pad</p>
</dd>
</span>
<p>It can happen that on a specific keyboard/iv>
<dl>
<dt>< class"">code "codehas_key(ey<code><java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 77
<dd>p>Checksif the key<var "rg></ recognized bythe <java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
</dd>
</dl>
<p< id"X7FD4E558816B3146" =XFD4E558816B3146<a>/>
<>21- span class=>towindows<span>/
<hedisplay of text code ">ncursescode hastwo aspects. The first is to get actual characters on the screen. The second is to specify attributes which influence the display, for example<span
<dl>
<t>< java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 81
<div class=ContSect< =java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 164
</dd>
<dt><strong class="Mark"><code class="code">waddnstr(win, str, len)</code></strong></dt>
<<>Writesthe string varclass"rg"str<var>to thewindowjava.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 412
</dd>
<dt><strong class="Mark"><code class="code">waddch(win, char)</code></strong></dt>
<iv "">a href=chap4htmlX86FA580F8055B2744 <span ""Functions<span><a>
</dd>
<dt><strong class="Mark"/span
< aborderwindow.Ifv class"">harlist<var> aaplainlisteight<strongclass=>/strong> characters these are taken for left/right/top/bottom sides and top-left/top-right/bottom-left/bottom-right corners. Otherwise s = /<pan class=nocss"&;nbsp;/java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 146
</dd>
<dt><strong class="Mark"><code class="code"/span
<<p>a verticalline length var "Arg><var orlong asfitting into
</dd>
<dt><strong class="Markspan class=ContSS"<br >span classjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 146
<dd><span class="ContSS"<br/<class;<span<ahref"chap4h#">.2-TopComponentOfWreathProductElement/></
<dd>
<dt><strong class="Mark"><code class="code">werase(win)</code></strong></dt>
<dd><p>Deletes all characters in the window.</p>
</dd>
<dt><strong class="Mark"><code class="code">wclear(win)</code></strong></dt>
<dd><p>Like <code class="code">werase</code>, but also calls <code class="code">clearok</code>.</p>
</dd>
<dt><strong class="Mark"><code class="code">wclrtobot(win)</code></strong></dt>
<dd><p>Deletes all characters from cursor position to the right and bottom.</p>
</dd>
<dt><strong class="Mark"><code class="code">wclrtoeol(win)</code></strong></dt>
<dd><p>Deletes all characters from cursor position to end of line.</p>
</dd>
<dt><strong class="Mark"><code class="code">winch(win)</code></strong></dt>
<dd><p>Returns the character at current cursor position, as integer and including color and attribute information.</p>
</dd>
<dt><strong class="Mark"><code class="code">getyx(win)</code></strong></dt>
<dd><p>Returns the current cursor position.</p>
</dd>
<dt><strong class="Mark"><code class="code">waddstr(win, str)</code></strong></dt>
<dd><p>Delegates to <code class="code">waddnstr(win, str, Length(str))</code>.</p>
</dd>
</dl>
<p><a id="X8091936586CCD248" name="X8091936586CCD248"></a></p>
<h5>2.1-6 <span class="Heading">Line drawing characters</span></h5>
<p>For drawing lines and grids in a terminal window you should use some "virtual" characters which are available as components of the record <code class="code">NCurses.lineDraw</code>. On some terminals these are nicely displayed as proper lines (on others they are simulated by ASCII characters). These are:</p>
<dl>
<dt><strong class="Mark"><code class="code">BLOCK</code></strong></dt>
<dd><p>solid block</p>
</dd>
<dt><strong class="Mark"><code class="code">BOARD</code></strong></dt>
<dd><p>board of squares</p>
</java.lang.StringIndexOutOfBoundsException: Range [703, 5) out of bounds for length 703
<dt><strong class="Mark"><code class="code">BTEE/LTEE/RTEE/TTEE</code></strong></dt>
<dd><p>bottom/left/right/top tee</p>
</dd>
<dt><strong class="Mark"><code class="code">BULLET</code></strong></dt>
<dd><p>bullet</p>
</dd>
<dt><strong class="Mark"><code class="code">CKBOARD</code></strong></dt>
<dd><p>checker board</p>
</dd>
<dt><strong class="Mark"><code class="code">DARROW/LARROW/RARROW/UARROW</code></strong></dt>
<dd><p>down/left/right/up arrow</p>
</dd>
<dt><strong class="Mark"><code class="code">DEGREE</code></strong></dt>
<dd><p>degree symbol</p>
</dd>
<dt><strong class="Mark"><code class="code">DIAMOND</code></strong></dt>
<dd><p>diamond</p>
</dd>
<dt><strong class="Mark"><code class="code">GEQUAL</code></strong></dt>
<dd><p>greater than or equal</p>
</dd>
<dt><strong class="Mark"><code class="code">HLINE/VLINE</code></strong></dt>
<dd><p>horizontal/vertical line</p>
</dd>
<dt><strong class="Mark"><code class="code">LANTERN</code></strong></dt>
<dd><p>lantern symbol</p>
</dd>
<dt><strong class="Mark"><code class="code">LEQUAL</code></strong></dt>
<dd><p>less than or equal</p>
</dd>
<dt><strong class="Mark"><code class="code">LLCORNER/LRCORNER/ULCORNER/URCORNER</code></strong></dt>
<dd><p>lower left/lower right/upper left/upper right corner</p>
</dd>
<dt><strong class="Mark"><code class="code">NEQUAL</code></strong></dt>
<dd><p>not equal</p>
</dd>
<dt><strong class="Mark"><code class="code">PI</code></strong></dt>
<dd><p>letter pi</p>
</dd>
<dt><strong class="Mark"><code class="code">PLMINUS</code></strong></dt>
<dd><p>plus-minus</p>
</dd>
<dt><strong class="Mark"><code class="code">PLUS</code></strong></dt>
<dd><p>crossing lines like a plus</p>
</dd>
<dt><strong class="Mark"><code class="code">S1/S3/S7/S9</code></strong></dt>
<dd><p>scan line 1/3/7/9</p>
</dd>
<dt><strong class="Mark"><code class="code">STERLING</code></strong></dt>
<dd><p>pound sterling</p>
</dd>
</dl>
<p><a id="X793D897483674294" name="X793D897483674294"></a></p>
<h5>2.1-7 <span class="Heading">Text attributes and colors</span></h5>
<p>In addition to the actual characters to be written to the screen the way they are displayed can be changed by additional <em>attributes</em>. (There should be no danger to mix up this notion of attributes with the one introduced in <a href="../../../doc/ref/chap13.html#X7C701DBF7BAE649A"><span class="RefLink">Reference: Attributes</span></a>.) The available attributes are stored in the record <code class="
<dl>
<dt><strong class="Mark"><code class="code">NORMAL</code></strong></dt>
<dd><p>normal display with no extra attributes.</p>
</dd>
<dt><strong class="Mark"><code class="code">STANDOUT</code></strong></dt>
<dd><p>displays text in the best highlighting mode of the terminal.</p>
</dd>
<dt><strong class="Mark"><code class="code">UNDERLINE</code></strong></dt>
<dd><p>underlines the text.</p>
</dd>
<dt><strong class="Mark"><code class="code">REVERSE</code></strong></dt>
<dd><p>display in reverse video by exchanging the foreground and background color.</p>
</dd>
<dt><strong class="Mark"><code class="code">BLINK</code></strong></dt>
<dd><p>displays the text blinking.</p>
</dd>
<dt><strong class="Mark"><code class="code">DIM</code></strong></dt>
<dd><p>displays the text half bright.</p>
</dd>
<dt><strong class="Mark"><code class="code">BOLD</code></strong></dt>
<dd><p>displays the text in a bold font.</p>
</dd>
</dl>
<p>Note that not all of these work with all types of terminals, or some may cause the same display. Furthermore, if <code class="code">NCurses.attrs.has_colors</code> is <code class="keyw">true</code> there is a list <code class="code">NCurses.attrs.ColorPairs</code> of attributes to set the foreground and background color. These should be accessed indirectly with <code class="func">NCurses.ColorAttr</code> (<a href="chap2.html#X83ADB4E37C105B8C"><span class="RefLink">2.2-1</span></a>). Attributes can be combined by adding their values (internally, they are represented by integers). They can also be added to the integer representing a character for use with <code class="code">waddch</code>.</p>
<p>The library functions for setting attributes are:</p>
<dl>
<dt><strong class="Mark"><code class="code">wattrset(win, attr)</code></strong></dt>
<dd><p>This sets the default (combined) attributes for a window which is added to all characters written to it; using <code class="code">NCurses.attrs.NORMAL</code> as attribute is a reset.</p>
</dd>
<dt><strong class="Mark">
<code class="code">wattron(win, attr)</code>/<code class="code">wattroff(win, attr)</code></strong></dt>
<dd><p>This sets or unsets one or some default attributes of the window without changing the others.</p>
</dd>
<dt><strong class="Mark"><code class="code">wattr_get(win)</code></strong></dt>
<dd><p>This returns the current default attribute and default color pair of a window.</p>
</dd>
<dt><strong class="Mark"><code class="code">wbkgdset(win, attr)</code></strong></dt>
<dd><p>This is similar to <code class="code">wattrset</code> but you can also add a character to <var class="Arg">attr</var> which is used as default instead of blanks.</p>
</dd>
<dt><strong class="Mark"><code class="code">wbkgd(win, attr)</code></strong></dt>
<dd><p>This function changes the attributes for all characters in the window to <var class="Arg">attr</var>, also used for further characters written to that window.</p>
</dd>
</dl>
<p><a id="X86675F5F791FEFEF" name="X86675F5F791FEFEF"></a></p>
<h5>2.1-8 <span class="Heading">Low level <code class="code">ncurses</code> mouse support</span></h5>
<p>Many <code class="code">xterm</code> based terminals support mouse events. The recognition of mouse events by the <code class="code">ncurses</code> input queue can be switched on and off. If switched on and a mouse event occurs, then <code class="code">NCurses.wgetch</code> gets <code class="code">NCurses.keys.MOUSE</code> if the <code class="code">keypad</code> flag is <code class="keyw">true</code> (see <a href="chap2.html#X7F23F5F48650A78B"><span class="RefLink">2.1-4</span></a>). If this is read one must call <code class="code">NCurses.getmouse</code> which reads further characters from the input queue and interprets them as details on the mouse event. In most cases the function <code class="func">NCurses.GetMouseEvent</code> (<a href="chap2.html#X799C033A7AB582D7"><span class="RefLink">2.2-10</span></a>) can be used in applications (it calls <code class="code">NCurses.getmouse</code>). The following low level functions are available as components of the record <code class="code">NCurses</code>.</p>
<p>The names of mouse events which may be possible are stored in the list <code class="code">NCurses.mouseEvents</code>, which starts <code class="code">[</code> <code class="code">"BUTTON1_PRESSED",</code> <code class="code">"BUTTON1_RELEASED",</code> <code class="code">"BUTTON1_CLICKED",</code> <code class="code">"BUTTON1_DOUBLE_CLICKED",</code> <code class="code">"BUTTON1_TRIPLE_CLICKED",</code> <code class="code">...</code> and contains the same for buttons number 2 to 5 and a few other events.</p>
<dl>
<dt><strong class="Mark">
<code class="code">mousemask(intlist)</code></strong></dt>
<dd><p>The argument <var class="Arg">intlist</var
</dd>
<dt><strong class="Mark">
<code class="code">getmouse()</code></strong></dt>
<dd><p>This function must be called after a key <code class="code">NCurses.keys.MOUSE</code> was read. It returns a list with three entries <code class="code">[y, x, intlist]</code> where <code class="code">y</code> and <code class="code">x</code> are the coordinates of the character cell where the mouse event occured and <code class="code">intlist</code> describes the event, it should have length one and refers to a position in <code class="code">NCurses.mouseEvents</code>.</p>
</dd>
<dt><strong class="Mark">
<code class="code">wenclose(win, y, x)</code></strong></dt>
<dd><p>This functions returns <code class="keyw">true</code> if the screen position <var class="Arg">y</var>, <var class="Arg">x</var> is within window <var class="Arg">win</var> and <code class="keyw">false</code> otherwise.</p>
</dd>
<dt><strong class="Mark">
<code class="code">mouseinterval(t)</code></strong></dt>
<dd><p>Sets the time to recognize a press and release of a mouse button as a click to <var class="Arg">t</var> milliseconds. (Note that this may have no effect because a window manager may catch this.)</p>
</dd>
</dl>
<p><a id="X83897BF984211EFD" name="X83897BF984211EFD"></a></p>
<h5>2.1-9 <span class="Heading">Miscellaneous function</span></h5>
<p>We also provide the <code class="code">ncurses</code> function <code class="code">mnap(msec)</code> which is a sleep for <var class="Arg">msec</var> milliseconds.</p>
<p>Furthermore, there a two utilities which can be useful for scripts and testing, namely a check if standard input or standard output are connected to terminals. These can be called as <code class="code">NCurses.IsStdinATty()</code> or <code class="code">NCurses.IsStdoutATty()</code>, respectively.</p>
<p><a id="X864A5C1C7F181B4B" name="X864A5C1C7F181B4B"></a></p>
<h4>2.2 <span class="Heading">The <code class="code">ncurses</code> <strong class="pkg">GAP</strong>
functions</span></h4>
<p>The functions of the <code class="code">ncurses</code> library <a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chap9.html">9</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
<p>In <strong class="pkg">GAP</strong> the <code class="code">ncurses</code> windows are accessed via integers (as returned by <code class="code">NCurses.newwin</code>). The standard screen <code class="code">stdscr</code> from the <code class="code">ncurses</code> library is available as window number <code class="code">0</code>. But this should not be used; to allow recursive applications of <code class="code">ncurses</code> always create a new window, wrap it in a panel and delete both when they are no longer needed.</p>
<p>Each window can be wrapped in one panel which is accessed by the same integer. (Window <code class="code">0</code> cannot be used with a panel.)</p>
<p>Coordinates in windows are the same zero based integers as in the corresponding <code class="code">C</code> functions. The interface of functions which <em>return</em> coordinates is slightly different from the <code class="code">C</code> version; they just return lists of integers and you just give the window as argument, e.g., <code class="code">NCurses.getmaxyx(win)</code> returns a list <code class="code">[nrows, ncols]</code> of two integers.</p>
<p>Characters to be written to a java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 0
<>writing application decide an appropriate terminal your windows, see <a href="chap2.html#X8499A3A384BF1F2D"><span class="RefLink">2.1-1</span></a> and the utility function <code class="func">NCurses.SetTerm</code> (<a href="chap2.html#X879D81B37A0A4E8F"><span class="RefLink">2.2-2</span></a>) below. Use <code class="code">NCurses.savetty()</code> and <code class="code">NCurses.resetty()</code> to save and restore the previous setting.</p>
< level functionality for displaying marked up text, see <code class="func">NCurses.PutLine</code> (<a href="chap2.html#X83FFD5047ADE716E"><span class="RefLink">2.2-6</span></a>) and <code classcode class="func">Ball</code>, for group, element and radius <a href="chap3.html#X8735855587CC029F">3.3-9</a> <java.lang.StringIndexOutOfBoundsException: Range [0, 116) out of bounds for length 109
<>Wenow describe someutility functionsputting exton awindow./p
<java.lang.StringIndexOutOfBoundsException: Range [27, 2) out of bounds for length 62
<h5>2.2-1 NCurses.ColorAttr</h5>
<><tr><td class"tdleft"><code class="func>#8227;NCurses.olorAttr<code>(< =A"><var><var =A>bgcolor<var </>< class=tdright">&;function&;<td>/tr>/table><div>
<p>Returns: an attribute for setting the foreground and background color to be used on a terminal window (itnbsp&bsp;nbsp;nbsp;, ;forZ xZ a =chap5.tmlX828438127DDAEBB4>5-3<a><br >
<div class="func&bsp;nbsp;n;&;,,u< =chap2.html#EB8C1C87F78A17224</> <br >
<>The usedused anyasdescribedin < href=chap2.#X793D897483674294"< class=R">.17/><a. var class="Arg">fgcolor</var> and <var class="Arg">bgcolor</var> can be given as strings, allowed are those in <code class="code">[ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white" nbsp & l, Z ahref=chap5.tml#>.-4/a < >
<pNotethat terminals can be configured in a way such that these named colors are not the colors which are actually displayed.</p>
<p>The variable <code class="func">NCurses.attrs.has_colors</code> is set to <code class="keyw">true</code> or <code class="keyw">false</code> if the terminal supports colors or not, java.lang.StringIndexOutOfBoundsException: Index 191 out of bounds for length 96
<p>For an attribute setting the foregroundcode class="code">ClassWiseOrderPreservingOn</code> <a href="chap2.html#X7A2E308C860B46E3">2.4-3<&bsp;&;&bsp;nbsp;rcwa x a =chap5.X8531E39785FFF8A7>.</>< /java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
<ivclass=example"<>
< class"APprompt"gap>/pan> spanclass=GAPinput>: .newwin0,,,);pan:=NCurses.new_panel(win);</>
<span classCollatz a =chap1.htmlX83java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 70
<span class="GAPprompt">gap></span> <span class="GAPinput">NCurses.wmove(win, 0, 0);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">for a in defc do for b in defc do</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.wattrset(win, NCurses.ColorAttr(a, b));</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.waddstr(win, Concatenation(a,"/",b,"\t"));</span>
<span class="GAPprompt">></span> <span class="GAPinput"> od; od;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">if NCurses.IsStdoutATty() then</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.update_panels();; NCurses.doupdate();;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.napms(5000);; # show for 5 seconds</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.endwin();; NCurses.del_panel(pan);; NCurses.delwin(win);;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> fi;</span>
</pre></div>
<p><a id="X879D81B37A0A4E8F" name="X879D81B37A0A4E8F"></a></p>
<h5>2.2-2 NCurses.SetTerm</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; NCurses.SetTerm</code>( [<var class="Arg">record</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function provides a unified interface to the various terminal setting functions of <code class="code">ncurses</code> listed in <a href="chap2.html#X8499A3A384BF1F2D"><span class="RefLink">2.1-1</span></a>. The optional argument is a record with components which are assigned to <code class="keyw">true</code> or <code class="keyw">false</code>. Recognised components are: <code class="code">cbreak</code>, <code class="code">echo</code>, <code class="code">nl</code>, <code class="code">intrflush</code>, <code class="code">leaveok</code>, <code class="code">scrollok</code>, <code class="code">keypad</code>, <code class="code">raw</code> (with the obvious meaning if set to <code class="keyw">true</code> or <code class="keyw">false</code>, respectively).</p>
<p>The default, if no argument is given, is <code class="code">rec(cbreak := true, echo := false, nl := false, intrflush := false, leaveok := true, scrollok := false, keypad := true)</code>. (This is a useful setting for many applications.) If there is an argument <var class="Arg">record</var>, then the given components overwrite the corresponding defaults.</p>
<p><a id="X81D1FC927C455AEB" name="X81D1FC927C455AEB"></a></p>
<h5>2.2-3 NCurses.IsAttributeLine</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; NCurses.IsAttributeLine</code>( <var class="Arg">obj</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: <code class="keyw">true<code ="">IntegralConjugatecode>,of rcwagroup<href=c.#831"34-2/> br />
<p>An <em>attribute line</em> describes a string with attributes. It is represented by either a string or a dense list of strings, integers, and Booleans immediatelycode =""IntegralizingConjugatorcode,of tamegroup < href=chap3.#X831ADC1584DE6113>.42</><r >
<>Ifanintegeris not bya then isis t attributefor followingcharacters, is it overwritesall previouslysetattributes. thatin withexplicit ispreferable,because a nicelynicelybhighlighted just by prepending a <code class="code">NCurses.attrs.STANDOUT</code> attribute.</p>
<p>For an overview of attributes, see <a href="chap2.html#X793D897483674294"><span"RefLink">2.-<<a.</p
<div class="example"><pre>
< class=GAPprompt">>/span><class="GAPinput">NCurses.IsAttributeLine( "abc" );</span>
true
< =GAPprompt>ap&t;</><spanclass=GAPinput">.IsAttributeLine( [abc, "" ] )</java.lang.StringIndexOutOfBoundsException: Index 113 out of bounds for length 113
false
<span class="GAPprompt">gap&code class="code">IsClassShift>,foran rcwamappinga =c.html"224/a <br /java.lang.StringIndexOutOfBoundsException: Range [117, 118) out of bounds for length 117
true
<span class="GAPprompt">gap></span> <span class="GAPinput">NCurses.IsAttributeLine( "" ); NCurses.IsAttributeLine( [] );</span>
true
false
</pre></div>
<p>The <em>empty string</em> is an attribute line whereas the <em>empty list</em> (which is not in <code class="func">IsStringRep</code> (<a href="../../../doc/ref/chap27.html#X7A17EDF8785C9F58"><span java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p><a id="X8372F0C57816A29E" name="X8372F0C57816A29E"></a></p>
<h5>2.2-4 NCurses.ConcatenationAttributeLines</h5spanclass=GAPprompt"g<span span class=APinput"NCurses(""; IsAttributeLine( [);/>
<div class=/>/java.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 12
<Returns: anattributeline<p
<p>For a list <var ><a id="X8372F0C57816A29E=X8372F0C57816A29E>/>/p>
<p>If the optional argument <var class="h5>2.2-4 NCurses.ConcatenationAttributeLines
<class"example"pre
<span class="GAPprompt">gap></span> <span p>: anattributeline./>
<span class="GAPprompt">gap&p>For a list <var class="Arg"/>of (see< class=f>.</>(a href"hap2html#81"< ="efLink>.-<span>/>),< =code>NCurses.</code> the attributeline concatenating the in <ar"Arg">lines<var>/>
<span class="GAPprompt">gap></span> <span class="GAPinput">NCurses.ConcatenationAttributeLines( [ plain_str, plain_str ] );</span>
"hellohello"
<span class="GAPprompt">gap></span> <spanjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[hello" 2097152, "bold
<span class="span class="GAPprompt">gap></span> <span class="GAPinput">plain_str:= "hello";;</span>
[ 2097152, "bold" ,"hello" java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
<span( [ with_attr, with_attr ];/
[ 2097152, "bold", 0, 2097152, "bold" ]
< class="GAPprompt">gap></span> <span class="GAPinput">NCurses.ConcatenationAttributeLines( [ with_attr, with_attr ], true );</span>
[, ", ,"old java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
</pre></span class"APprompt">g;/pan span =G">Curses.oncatenationAttributeLines ;span
<p><a id="X7D2EB0BF82C4F25C" name="X7D2EB0BF82C4F25C"></a></p>
<h5>2.2-5 NCurses.java.lang.StringIndexOutOfBoundsException: Range [18, 39) out of bounds for length 36
<div
<p: attributeline./>
<>anattribute ="Arg"/var ( < class=f".<code>(a href="chap2.XD1FC927C455AEB>< class="".23/span</) a var =""width</> codeclass=>.epeatedAttributeLine/ode>returns with<var ="rg"width/ characters(see <code class="func"NCurses.idthAttributeLine<code> < ".#82"< ""227/<a) is obtainedbyconcatenatingsufficientlymanycopiesof<"">/ cuttingoff a tail .<p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">NCurses.RepeatedAttributeLine( "12345", 23 );</span>
"12345123451234512345123"
<span class="GAPprompt">gap></span> <span class="GAPinput">NCurses.RepeatedAttributeLine( [ NCurses.attrs.BOLD, "12345" ], 13 );</span>
[ 2097152, "12345", 0, 2097152, "12345", 0, 2097152, "123" ]
</pre></div>
<p< id"X83FFD5047ADE716E"name=XFFD5047ADE716E></a<p>
<h5>2.2-6 NCurses.PutLine</h5>
<class="<class="func"width=100"<>td java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 337
<p>Returns: <code class="keyw">true</code> if <var class="Arg">lines</var> were written, otherwise <code class="keyw">false</code>.</p>
<p>The argument <12345123451234512345123
<p>If the argument <var class="Arg">skip</var> is given, it must be a nonnegative[2097152, "2345" ,2097152 12345,0 2097152 123
<<a=X82C53ACD805EE0C3 java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 62
<>2.- NCurses.WidthAttributeLine/h5
<div class="func"><table div class="func"><table classfunc width"100"<tr>td class="tdleft ="> ="&8227; NCurses.utLine<code>( var ="Arg">win</var>, var =Arg></>, var ="rg><var,<class=A"></>,< class=Arg></var>] )td>td class=tdright"(nbspfunctionnbsp;</td<tr>/able/
<pThe < "">lines<var canbealof attributelines "func>IsAttributeLine/> <a href"h#"< class=R"2.2-<span<a>) orasingle writes lines < ""win/var and below ofposition<varclass="rg><var>,<var =Arg"><var><p
<Foran < =Arg"line/var>(see"hX81D1FC927C455AEB"<class="RefLink">2.2-3</span></a>)), the function returns the number of displayed characters of <var class="Arg">line</var>.</p>
<div class="example"><pre>
<span h5>2.- W<h5
5
<span class="GAPprompt">gap></span> <span<divclass="func><table =f"width="100"<tdclass"dleft"<codeclass=func>#;NCurses.WidthAttributeLinecode(<class""line/var)/td<tdclass="dright">&function )</<tr<table></div>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.attrs.NORMAL, "de" ] );</span>
5
</pre></div>
<p><a id="X790715F683BF1E66" name class=example>pre
<h5>2.2-8 NCurses.5
< class="tdleft>code "unc>#;NCurses.rid/(varclass=Arg"win<var, <ar class=Arg"trowvar,< "Arg>brow</var> < =Arg></> var class=Arg>/> var class""rowinds<var> varclass=Arg>/ </>td class=tdright>&fnbsp;)/<tr</table<div
<p>This function draws a grid of horizontal and vertical lines on the window <var class="Arg">win</var>, using the line drawing characters explained in <a href="chap2.html#X8091936586CCD248"><span class="RefLink"span class"">gt<span><span java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 104
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput"<p> a ofandvertical onthe<varclass""win</var>, using theline explainedin< ="hap2.#X8091936586CCD248"<class=R>.-<span<a>. given specifythe topand the , leftand , rowand olumn shouldbedrawn.<java.lang.StringIndexOutOfBoundsException: Index 390 out of bounds for length 390
<gt<span< ="> : NCurses.(,0,,)<span>
<span class="GAPprompt">>span class=GAPprompt"gap&t<span><class="GAPinput">fun := function() local win, pan;</span>
<span classspan class=""></ span class="" : n00,,);span>
< "">gt;<span> <span class=GAPinput" NCurses.utLine(,12,0 "ress lt&;to quit";/java.lang.StringIndexOutOfBoundsException: Range [130, 129) out of bounds for length 130
< ="&t;/span>< class=GAPinput" u(;NCursesd(;</>
<spanspan class"GAPprompt">></span> <span class="GAPinput"> NCurses.PutLine(win, 12, 0, "Press <Enter> to quit");</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.endwin();</span>
<span class="GAPprompt">></span> <span class="GAPinput"> NCurses.del_panel(span =GAPprompt>gt<span spanclass=G" endwin(;/pan>
<span class="GAPprompt">gap></span> <span class="GAPinput">fun();</span>
<pre>/div>
<< id"82801587B37D571" =XB801587><a<p
<h5>2.2-9 NCurses.WBorder</h5>
< class=func">table class" "%><tr>td class=t"<codeclass=func" NCurses.WBorder<code> =Arg"<>[ varclass=Arg>hars/var> </td<tdclass="tdright">( function )</td></tr></table></div>
<p>This isjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p><a id="X799C033A7AB582D7" name="X799C033A7AB582D7"divclass"func"<class=func"width="00%>tr<class=tdleft"<class=func">&8227 .Border<code(< ""win/var> varclass=Arg"chars/var>])/td>td ""(nbsp;unction )/</>/><div
<h5>2.2-10 <span java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
width=%>tr<td class=>codeclass""#; /code(<java.lang.StringIndexOutOfBoundsException: Range [131, 130) out of bounds for length 224
<p>Returns: a record</p>
<class=f>table class="func" width""<<td "dleft">code class="unc"&>8227;NCurses.etMouseEventcode()/td<class""(nfn;<td>tr<table>div
<p>Returns: a list of records</p>
<p><code class="code">ncurses</code> allows on some terminals (<code class="code">xterm</code> and related) to catch mouse events. In principle a subset of events can be caught, see <code class="code">mousemask</code> in <a href="chap2.html#X86675F5F791FEFEF"><span class="RefLink">2.1-8</span></a>. But this does not seem to work well with proper subsets of possible events (probably due to intermediate processes X, window manager, terminal application, ...). Therefore we suggest to catch either all or no mouse events in applications.</p>
<p>This can be done with <code class="func">NCurses.UseMouse</code> with argument <code class="keyw">true</code> to switch on the recognition of mouse events and <code class="keyw">false</code> to switch it off. The function returns a record with components <code class="code">.new</code> and <code class="code">.old</code> which are both set to the status <code class="keyw">true</code> or <code class="keyw">false</code> from after and before the call, respectively. (There does not seem to be a possibility to get the current status without calling <code class="func">NCurses.UseMouse</code>.) If you call the function with argument <code class="keyw">true</code> and the <code class="code">.new</code> component of
<p>When the recognition of mouse events is switched on and a mouse event occurs then the key <code class="code">NCurses.keys.MOUSE</code> is found in the input queue, see <code class="code">wgetch</code> in <a href="chap2.html#X7F23F5F48650A78B"><span class="RefLink">2.1-4</span></a>. If this key is read the low level function <code class="code">NCurses.getmouse</code> must be called to fetch further details about the event from the input queue, see <a href="chap2.html#X86675F5F791FEFEF"><span class="RefLink">2.1-8</span></a>. In many cases this can be done by calling the function <code class="func">NCurses.GetMouseEvent</code> which also generates additional information. The return value is a list of records, one for each panel over which the event occured, these panels sorted from top to bottom (so, often you will just need the first entry if there is any). Each of these records has components <code class="code">.win</code>, the corresponding window of the panel, <code class="code">.y</code> and <code class="code">.x</code>, the relative coordinates in window <code class="code">.win</code> where the event occured, and <code class="code">.event</code>, which is bound to one of the strings in <code class="code">NCurses.mouseEvents</code> which describes the event.</p>
< to give mouse control to your application,java.lang.StringIndexOutOfBoundsException: Range [241, 240) out of bounds for length 339
<p><a id="X85FB1D7878A322EB" name="X85FB1D7878A322EB"></a></p>
<2211NCursesS/>
< class="func"<table="func "100"<>td class=t"<class"func>ã NCurses.SaveWin</(<class=""win</ar> )td>td "fnbsp)<td>/>/></
<div class="func"><table class="funcjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/>( varclass""></,<class=A"cont<var>)/td>td java.lang.StringIndexOutOfBoundsException: Range [200, 199) out of bounds for length 256
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; NCurses
<java.lang.StringIndexOutOfBoundsException: Range [64, 2) out of bounds for length 94
<p>These functions can be p utility<ode java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 199
<p>The function <code class="func">NCurses.StringsSaveWin</code> translates data <java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 0
<p>The
<>utility < =func">.</>can outputof<class=f"Curses./ as ofthe- corner fitsonthe screen./>
<div class="chlinkprevnextbot"> <a java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href= | | |