File: chap1_mj.html

package info (click to toggle)
gap-browse 1.8.21%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,296 kB
  • sloc: xml: 1,961; ansic: 1,342; makefile: 163; javascript: 155; sh: 20
file content (157 lines) | stat: -rw-r--r-- 15,312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?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>
<script type="text/javascript"
  src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>GAP (Browse) - Chapter 1: Introduction and Overview</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="chap1"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chapA_mj.html">A</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0_mj.html">[Top of Book]</a>&nbsp;  <a href="chap0_mj.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap0_mj.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap2_mj.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap1.html">[MathJax off]</a></p>
<p><a id="X794AAAFB7FFAA46C" name="X794AAAFB7FFAA46C"></a></p>
<div class="ChapSects"><a href="chap1_mj.html#X794AAAFB7FFAA46C">1 <span class="Heading">Introduction and Overview</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1_mj.html#X7DFB63A97E67C0A1">1.1 <span class="Heading">Introduction</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1_mj.html#X8389AD927B74BA4A">1.2 <span class="Heading">Overview</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X87A6D24784C21E54">1.2-1 <span class="Heading">The <code class="code">ncurses</code> interface</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X80C054D881502061">1.2-2 <span class="Heading">Applications of 
<code class="code">ncurses</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X7CF47ACC83A95689">1.2-3 <span class="Heading">The interface to browse two-dimensional arrays</span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X7A0055DE7A2C5DC9">1.2-4 <span class="Heading">Applications of the generic function
<code class="code">NCurses.BrowseGeneric</code></span></a>
</span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap1_mj.html#X825F23FF825334B4">1.3 <span class="Heading">User preferences provided by the <strong class="pkg">Browse</strong> package</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X859EAEDA850D3B02">1.3-1 <span class="Heading">The user preference <code class="code">EnableMouseEvents</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X7D242D4286EAB00A">1.3-2 <span class="Heading">The user preference <code class="code">SelectHelpMatches</code></span></a>
</span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap1_mj.html#X7BC3B5827A4B09C3">1.3-3 <span class="Heading">The user preference <code class="code">SelectPackageName</code></span></a>
</span>
</div></div>
</div>

<h3>1 <span class="Heading">Introduction and Overview</span></h3>

<p><a id="X7DFB63A97E67C0A1" name="X7DFB63A97E67C0A1"></a></p>

<h4>1.1 <span class="Heading">Introduction</span></h4>

<p>The motivation of the package <strong class="pkg">Browse</strong> was to provide better functionality for displaying two-dimensional arrays of data (e.g., character tables): moving through the data without loosing row and column labels, searching for text, displaying extra information, hiding information, allowing interactive user input, ...</p>

<p>We wanted to achieve this by using the capabilities of the terminal emulations in which <strong class="pkg">GAP</strong> is running, and not by some external graphical user interface. For this we have chosen to use the widely available <code class="code">C</code>-library <code class="code">ncurses</code>, see <a href="chapBib_mj.html#biBNCursesWeb">[NCu]</a>. It contains functions to find out terminal capabilities, to change properties of terminals, to place text, to handle several windows with overlapping, ... To use these functions the terminal is switched to a <em>visual mode</em> so that the display of the non-visual mode of your terminal in which <strong class="pkg">GAP</strong> is running is not clobbered.</p>

<p><strong class="pkg">Browse</strong> has now three levels of functionality:</p>


<dl>
<dt><strong class="Mark">A low level interface to <code class="code">ncurses</code></strong></dt>
<dd><p>This may be interesting for all kinds of applications which want to display text with some markup including colors, maybe in several windows, using the available capabilities of a terminal.</p>

</dd>
<dt><strong class="Mark">A medium level interface to a generic function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>)</strong></dt>
<dd><p>This is for displaying two-dimensional arrays of data, handles labels for rows and columns, searching, sorting, binding keys to actions, ... If you want to implement such applications for further kinds of data, first look at the examples in Section <code class="func">BrowseData.IsBrowseTable</code> (<a href="chap4_mj.html#X81007E2F8552523B"><span class="RefLink">4.2-3</span></a>), then check what can be copied from the examples in Chapter <a href="chap6_mj.html#X78D4F8EA79405AF9"><span class="RefLink">6</span></a>, and consult the descriptions in Chapters <a href="chap4_mj.html#X877E60DE7F53FDEC"><span class="RefLink">4</span></a> and <a href="chap5_mj.html#X82DDDC1783B4CA30"><span class="RefLink">5</span></a>.</p>

</dd>
<dt><strong class="Mark">Applications of these interfaces</strong></dt>
<dd><p>We provide some applications of the <code class="code">ncurses</code> interface and of the generic <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) function. These may be interesting for end users, and also as examples for programmers of further applications. This includes (of course) a method for browsing through character tables, functions for browsing through data collections, several games, and an interface for demos.</p>

</dd>
</dl>
<p>Users interested only in these applications should perhaps just try <code class="code">NCurses.Demo()</code>.</p>

<p><a id="X8389AD927B74BA4A" name="X8389AD927B74BA4A"></a></p>

<h4>1.2 <span class="Heading">Overview</span></h4>

<p><a id="X87A6D24784C21E54" name="X87A6D24784C21E54"></a></p>

<h5>1.2-1 <span class="Heading">The <code class="code">ncurses</code> interface</span></h5>

<p>Chapter <a href="chap2_mj.html#X7E049B1185A56B30"><span class="RefLink">2</span></a> describes <strong class="pkg">GAP</strong>'s interface to the <code class="code">ncurses</code> <code class="code">C</code>-library. The imported <code class="code">C</code>-functions are shortly explained, but for further details we refer to the documentation of that library. There are also a few utility functions on <strong class="pkg">GAP</strong> level, such as <code class="func">NCurses.SetTerm</code> (<a href="chap2_mj.html#X879D81B37A0A4E8F"><span class="RefLink">2.2-2</span></a>), which simplify the use of the library.</p>

<p>The concept of an <em>attribute line</em>, see <code class="func">NCurses.IsAttributeLine</code> (<a href="chap2_mj.html#X81D1FC927C455AEB"><span class="RefLink">2.2-3</span></a>), helps to deal with text with markup for its display in a terminal window.</p>

<p>This chapter is for users who want to write their own applications of <code class="code">ncurses</code>.</p>

<p><a id="X80C054D881502061" name="X80C054D881502061"></a></p>

<h5>1.2-2 <span class="Heading">Applications of 
<code class="code">ncurses</code></span></h5>

<p>In Chapter <a href="chap3_mj.html#X7F3A63788200AB4F"><span class="RefLink">3</span></a> we describe some interactive applications of the <code class="code">ncurses</code> interface. For example, there is <code class="func">NCurses.Select</code> (<a href="chap3_mj.html#X833D321E86528981"><span class="RefLink">3.1-2</span></a>) for asking a user to choose one or several of a given list of items. There is also a demo function <code class="func">NCurses.Demo</code> (<a href="chap3_mj.html#X8681359F8064597B"><span class="RefLink">3.2-1</span></a>) which we use to demonstrate features of the <strong class="pkg">Browse</strong> package, but it may be interesting for other kinds of demos as well.</p>

<p><a id="X7CF47ACC83A95689" name="X7CF47ACC83A95689"></a></p>

<h5>1.2-3 <span class="Heading">The interface to browse two-dimensional arrays</span></h5>

<p>Chapters <a href="chap4_mj.html#X877E60DE7F53FDEC"><span class="RefLink">4</span></a> and <a href="chap5_mj.html#X82DDDC1783B4CA30"><span class="RefLink">5</span></a> describe the interface to a generic function <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) which can be used for an interactive display of two-dimensional arrays of data. The first of these covers the basic functionality which may be sufficient for many applications and the second gives more technical details. With interactive display we mean that it is not only possible to scroll through the data, but one can search for strings, sort by rows or columns, select entries, bind arbitrary actions to keys and mouse events, ask for help, and more.</p>

<p><a id="X7A0055DE7A2C5DC9" name="X7A0055DE7A2C5DC9"></a></p>

<h5>1.2-4 <span class="Heading">Applications of the generic function
<code class="code">NCurses.BrowseGeneric</code></span></h5>

<p>In Chapter <a href="chap6_mj.html#X78D4F8EA79405AF9"><span class="RefLink">6</span></a> we describe several applications which are using the generic <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) interface introduced before. They are provided as prototype applications and so we include some implementation remarks in their documentation.</p>

<p>Users who just want to use these applications hopefully do not need to read this <strong class="pkg">Browse</strong> manual, all applications are coming with built-in help windows.</p>

<p>There are different kinds of applications. First, there are methods for browsing through character tables and tables of marks (our original motivation for this package). Then there are applications for browsing through data collections, e.g., the data available through the <strong class="pkg">AtlasRep</strong> package, the <strong class="pkg">GAP</strong> bibliography or the sections of the <strong class="pkg">GAP</strong> manuals. Finally, there are several games like Sam Loyd's fifteen puzzle (generalized), peg solitaire, and Sudoku (including functions to create new puzzles and to solve puzzles).</p>

<p><a id="X825F23FF825334B4" name="X825F23FF825334B4"></a></p>

<h4>1.3 <span class="Heading">User preferences provided by the <strong class="pkg">Browse</strong> package</span></h4>

<p>See <code class="func">SetUserPreference</code> (<a href="../../../doc/ref/chap3_mj.html#X7B0AD104839B6C3C"><span class="RefLink">Reference: SetUserPreference</span></a>) for <strong class="pkg">GAP</strong>'s user preferences mechanism, and <code class="func">BrowseUserPreferences</code> (<a href="chap6_mj.html#X7A7B712E7A06449F"><span class="RefLink">6.10-1</span></a>) for viewing and modifying user preferences.</p>

<p><a id="X859EAEDA850D3B02" name="X859EAEDA850D3B02"></a></p>

<h5>1.3-1 <span class="Heading">The user preference <code class="code">EnableMouseEvents</code></span></h5>

<p>This user preference defines whether mouse events are enabled by default in visual mode (value <code class="keyw">true</code>) or not (value <code class="keyw">false</code>, this is the default). During the <strong class="pkg">GAP</strong> session, the value can be changed using <code class="func">NCurses.UseMouse</code> (<a href="chap2_mj.html#X799C033A7AB582D7"><span class="RefLink">2.2-10</span></a>). Inside browse applications based on <code class="func">NCurses.BrowseGeneric</code> (<a href="chap4_mj.html#X85FC163D87FAFD12"><span class="RefLink">4.3-1</span></a>) or <code class="func">NCurses.Select</code> (<a href="chap3_mj.html#X833D321E86528981"><span class="RefLink">3.1-2</span></a>), the value can be toggled usually by hitting the <strong class="button">M</strong> key.</p>

<p><a id="X7D242D4286EAB00A" name="X7D242D4286EAB00A"></a></p>

<h5>1.3-2 <span class="Heading">The user preference <code class="code">SelectHelpMatches</code></span></h5>

<p>In the case that the <strong class="pkg">GAP</strong> help system finds multiple matches, <code class="keyw">true</code> (the default) means that the user can choose one entry from a list that is shown via <code class="func">NCurses.Select</code> (<a href="chap3_mj.html#X833D321E86528981"><span class="RefLink">3.1-2</span></a>), and <code class="keyw">false</code> means that the matches are just shown in a pager.</p>

<p><a id="X7BC3B5827A4B09C3" name="X7BC3B5827A4B09C3"></a></p>

<h5>1.3-3 <span class="Heading">The user preference <code class="code">SelectPackageName</code></span></h5>

<p>In the case that <code class="func">LoadPackage</code> (<a href="../../../doc/ref/chap76_mj.html#X79B373A77B29D1F5"><span class="RefLink">Reference: LoadPackage</span></a>) is called with a prefix of some package names, <code class="keyw">true</code> (the default) means that the user can choose one matching entry, and <code class="keyw">false</code> means that the matches are just printed.</p>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0_mj.html">[Top of Book]</a>&nbsp;  <a href="chap0_mj.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap0_mj.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap2_mj.html">[Next Chapter]</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a>  <a href="chap1_mj.html">1</a>  <a href="chap2_mj.html">2</a>  <a href="chap3_mj.html">3</a>  <a href="chap4_mj.html">4</a>  <a href="chap5_mj.html">5</a>  <a href="chap6_mj.html">6</a>  <a href="chapA_mj.html">A</a>  <a href="chapBib_mj.html">Bib</a>  <a href="chapInd_mj.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>