[Top] | [Contents] | [Index] | [ ? ] |
1. Libtui Developer Reference
2. Overview
3. Basics
4. Linking
5. Autoconf
6. Header Files
7. Required Calls
8. Interface
9. Core Functions
10. Windows
11. Creating and Destroying Windows
12. Manipulating Windows
13. Getting Window Information
14. Window Example
15. Menu System
16. Menubars
17. Menus
18. Menu Items
19. Menu Example
20. Implementation
21. Libtui Copying Conditions
22. Contributors
Index
Function Index
Data Type Index
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
$Revision: 1.7 $
2. Overview What is Libtui? 3. Basics How to use Libtui in your application. 8. Interface Function-call interface of for Libtui. 20. Implementation Some notes on the internals of Libtui.
21. Libtui Copying Conditions License and copying information. 22. Contributors People who have contributed to Libtui.
Index Index of concepts. Function Index Index of function names. Data Type Index Index of data types.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Libtui is designed to be used as a helper library along the side of your curses-based applications. However, it can also be used as a layer on top of curses without needing to write any curses-related code. It is geared toward developing console applications. As such, it aims to include things like:
All Libtui interface functions are prefixed with `tui'. Internal Libtui functions are prefixed with `__tui'. As a user of Libtui, you will only be concerned with the interface functions, not the internal ones.
Most Libtui data structures are managed with a new and delete
call. For example, to manage a tuiWindow
you would use the following
functions:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4. Linking How to link Libtui 5. Autoconf Rules for autoconf to detect Libtui. 6. Header Files What headers to include. 7. Required Calls Required actions before and after using Libtui.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
-ltui
For example:
$ gcc -o myapp myapp.c -ltui |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
AC_CHECK_LIB(tui, tuiExit,[ LIBS="$LIBS -ltui" ],[ AC_MSG_ERROR([ The Libtui library is needed for compiling xyz app. You can get it at: http://www.wsmake.org/~mike/software/libtui/]) ]) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <tui/tui.h> |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Libtui must be initialized before your application can use the available features. There are two ways to do this:
tuiInitMore(NULL); |
tuiInit(NULL); |
The tuiInitMore
function handles curses initialization whereas
tuiInit
expects you to do it in your application. The parameter
is a callback for internal errors so that you can clean up your
application's state before quitting. Use NULL
if you don't need
that.
Now you can begin using Libtui features. As mentioned in the Overview section, each of the features has a start and end function. See section 2. Overview.
TODO: show examples, etc...
After the application is through running, it is recommended to call an
exit function for Libtui if tuiInitMore
was used to
initialize libtui:
tuiExitMore(0); |
The parameter is the error number. 0
represents success (no error).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9. Core Functions 10. Windows 15. Menu System
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The core functions represent critical access points into the Libtui library. They are defined in `tui/core.h' and are included by `tui/tui.h'.
Each core function is usually paired with a "More" version. These "More" versions perform the necessary curses calls for Libtui to function properly. Non-"More" versions are provided for when finer tuning of curses is desired.
exitfunc
is a callback used when an error occurs in
Libtui or when tuiEnd
or tuiEndMore
is called.
exitfunc
may be NULL
. When exitfunc
is called
from Libtui, the integer passed is 0 on success (no error),
or the value of errno.
If error
is non-0, the callback set by tuiInitMore
or
tuiInit
is called with that value (provided that the callback
is not NULL
).
doupdate
function.
exitfunc
is a callback used when an error occurs in
Libtui or when tuiEnd
or tuiEndMore
is called.
exitfunc
may be NULL
. When exitfunc
is called
from Libtui, the integer passed is 0 on success (no error),
or the value of errno.
If error
is non-0, the callback set by tuiInitMore
or
tuiInit
is called with that value (provided that the callback
is not NULL
).
doupdate
function.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
11. Creating and Destroying Windows 12. Manipulating Windows 13. Getting Window Information 14. Window Example
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
x
(column) and y
(row) are the screen position for the window.
If x
or y
is greater than 0, the value is used directly for
the screen position. If x
or y
is less than 0, the absolute
value is used as a percentage of screen width/height.
w
(width) and h
(height) specify the window's size. if w
or h
is greater than 0, the value is used directly for the size. If
w
or h
is equal to 0, then the current maximum width or height
of the screen is used, respectively. If w
or h
is less than 0,
the absolute value is used as a percentage of the current screen width or
height respectively.
vw
(virtual width) and vh
(virtual height) specify the window
buffer size. vw
and vh
are treated the same as w
and
h
.
draw
is a callback that is called from tuiWindowRefresh
.
If bdraw
is non-NULL, an additional window will be created around
the window being created. The bdraw
callback is called from
tuiWindowRefresh
before the draw
callback for it's associated
window. If bdraw
is NULL, no border will be created, and no callback
will happen for the border.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
direction
. The direction types are:
location
is a value greater than 0 and less than the
buffer size. It will only scroll if location
is not already
in the view area.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
out
file pointer. The file pointer must already be open
with write capabilities.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To create a menu system, you begin by creating a tuiMenuBar
.
Then you can create tuiMenu
s for the menubar. Then
tuiMenuItem
s can be created for each menu.
16. Menubars 17. Menus 18. Menu Items 19. Menu Example
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
tuiMenuBar
and returns it. The pos
parameter specifies which side of the screen the menubar should be.
Currently only TUIMENUBAR_TOP
for the top of the screen is
supported. TUIMENUBAR_BOT
will be supported in the future for
having a menubar on the bottom of the screen. The at
parameter
is a attribute specifier for the menubar. This parameter is directly
related to the Curses attribute types.
mb
.
It also causes any attached menus to be menubarless.
mb
is the menubar
to move to, m
is the menu being moved, and pos
is the
position on the menubar to move to. FIXME: xref to position types
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
TODO: put notes about internals here
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Hey you! Want to help with this document and have your name put in here? Send updates to mike@wsmake.org.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | A B C G L M R W |
---|
Jump to: | A B C G L M R W |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | T |
---|
Jump to: | T |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[Top] | [Contents] | [Index] | [ ? ] |
1. Libtui Developer Reference
2. Overview
3. Basics
4. Linking
5. Autoconf
6. Header Files
7. Required Calls
8. Interface
9. Core Functions
10. Windows
11. Creating and Destroying Windows
12. Manipulating Windows
13. Getting Window Information
14. Window Example
15. Menu System
16. Menubars
17. Menus
18. Menu Items
19. Menu Example
20. Implementation
21. Libtui Copying Conditions
22. Contributors
Index
Function Index
Data Type Index
[Top] | [Contents] | [Index] | [ ? ] |
1. Libtui Developer Reference
2. Overview
3. Basics
4. Linking
5. Autoconf
6. Header Files
7. Required Calls
8. Interface
9. Core Functions
10. Windows
11. Creating and Destroying Windows
12. Manipulating Windows
13. Getting Window Information
14. Window Example
15. Menu System
16. Menubars
17. Menus
18. Menu Items
19. Menu Example
20. Implementation
21. Libtui Copying Conditions
22. Contributors
Index
Function Index
Data Type Index
[Top] | [Contents] | [Index] | [ ? ] |
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | previous or up-and-previous section | 1.1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next or up-and-next section | 1.3 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | concept index | |
[ ? ] | About | this page |