Sponsored Content
Full Discussion: curses.h
Top Forums UNIX for Dummies Questions & Answers curses.h Post 9792 by rwb1959 on Friday 2nd of November 2001 03:07:37 PM
Old 11-02-2001
You need to use the "box" library call...

box Subroutine
Purpose
Draws borders from single-byte characters and renditions.

Library
Curses Library (libcurses.a)

Syntax
#include <curses.h>
int box(WINDOW *win,
chtype verch,
chtype horch);
Description
The box subroutine draws a border around the edges of the specified window. This subroutine does not advance the cursor position. This subroutine does not perform special character processing or perform wrapping.

The box subroutine (*win, verch, horch) has an effect equivalent to:

wborder(win, verch, verch, horch, horch, 0, 0, 0, 0);
Parameters
horch Specifies the character to draw the horizontal lines of the box. The character must be a 1-column character.
verch Specifies the character to draw the vertical lines of the box. The character must be a 1-column character.
*win Specifies the window to draw the box in or around.

Return Values
Upon successful completion, the box function returns OK. Otherwise, it returns ERR.

Examples
To draw a box around the user-defined window, my_window , using | (pipe) as the vertical character and - (minus sign) as the horizontal character, enter:
WINDOW *my_window;
box(my_window, '|', '-');
To draw a box around my_window using the default characters ACS_VLINE and ACS_HLINE, enter:
WINDOW *my_window;
box(my_window, 0, 0);
Implementation Specifics
This subroutine is part of Base Operating System (BOS) Runtime.

Related Information
The border, box_set, and hline subroutines.

...take a look at...
http://www.unet.univie.ac.at/aix/aix...ogc/curses.htm

...for a good on-line reference. I would recommend purchasing
the O'Reilly book, "Programming with curses"...
http://www.oreilly.com/catalog/curses/

Enjoy. Smilie
This User Gave Thanks to rwb1959 For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

curses (ncurses) library question

Hi again. I'm using the curses functions simply to output data to the screen in certain areas. Very simple, just using the full screen, no windows. The problem is that I'm calling mvprintw from within several child processes in the same session, and the output is going bananas. ie, no... (1 Reply)
Discussion started by: TelePlayer
1 Replies

2. Programming

Curses.h not found ...

I am writing a program which uses curses.h. I do not have any problem when compilng it in Digital UNIX at my school. But when I compiling it in Mandrake Linux 6.0 at my home, I got a error message said that curses.h not found. Does curses.h include in Linux? How to slove my problem? (2 Replies)
Discussion started by: MacMonster
2 Replies

3. Programming

curses.h

hi all i get a segmentation fault error in the following program. couldn't understand why it happens. can anyone explain what is really happening. s1.c #include<curses.h> main(){ int c; noecho(); cbreak(); c=getch(); printf("%c",(char)c); } I compiled this program as cc s1.c... (2 Replies)
Discussion started by: bankpro
2 Replies

4. Programming

Shared memory with curses

My vendor application has created serveral message queues in the AIX platform. I would like view the real-time message in the queues and output the contents on the screen by using curses library in UNIX. I know how to do it with curses, but I have no idea to view the contents of the queue. Is... (1 Reply)
Discussion started by: kkyim
1 Replies

5. Programming

<curses.h>

i want to write a C programm.i want to read a 2-dimension array from a file and using the library <curses.h> i want to delineate to the monitor the array.the monitor must every 40ms being refresing.i want to use the setitimer() function to achive this.the array will be similar like above (2 Replies)
Discussion started by: nektarios4u
2 Replies

6. Shell Programming and Scripting

ksh88 - curses

I was wondering if there is anyway to use the curses library with ksh88. I saw Shell Curses function library which says I can use /usr/local/functions/shellcurses on ksh93 but I am on ksh88. I am on a HP-UX box. (0 Replies)
Discussion started by: IMTheNachoMan
0 Replies

7. Programming

Resize current window with Curses

Hi. I am beginning with Unix C Curses Library and i would like to know if it's possible to resize my current window. In other words, i am working with a Putty Client over my Windows system and with a telnet/ssh connection to linux. I want to build a small linux application using C Curses... (10 Replies)
Discussion started by: pogdorica
10 Replies

8. Programming

Curses not updating LINES/COLS

I'm working with an extremely outdated and old system at work. We do not have ncurses, but we do have curses. I need to make a user interface for users connecting with xterm. One issue I've encountered is if the user resizes the window, I'd like to provide functionality to redraw the screen with... (4 Replies)
Discussion started by: nwboy74
4 Replies

9. Programming

Curses::UI script question

I recently moved from linux to aix, version 6.1, perl 5.8.8. We were running a perl script using curses::ui for a user interface which was working fine on linux, but the issue on aix is no mouse support. I have tried with the -mouse-support => 1, to no avail. I'm not sure about aix's xterm... (0 Replies)
Discussion started by: islanderman
0 Replies

10. UNIX for Dummies Questions & Answers

Need help for using curses library

I am using curses library for graphics on linux. I have created a static GUI which contains two boxes which cover the whole screen, but when i make the screen small it shows only the half GUI, it does'nt adjust according to the the new window size. I want the GUI to adjust according to the... (1 Reply)
Discussion started by: apapap
1 Replies
curses_variables(3NCURSES)												curses_variables(3NCURSES)

NAME
COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES, TABSIZE, curscr, newscr, stdscr - curses global variables SYNOPSIS
#include <curses.h> int COLOR_PAIRS; int COLORS; int COLS; int ESCDELAY; int LINES; int TABSIZE; WINDOW * curscr; WINDOW * newscr; WINDOW * stdscr; DESCRIPTION
This page summarizes variables provided by the curses library. A more complete description is given in the curses(3X) manual page. Depending on the configuration, these may be actual variables, or macros (see threads(3NCURSES)) which provide read-only access to curses's state. In either case, applications should treat them as read-only to avoid confusing the library. COLOR_PAIRS After initializing curses, this variable contains the number of color pairs which the terminal can support. Usually the number of color pairs will be the product COLORS*COLORS, however this is not always true: o a few terminals use HLS colors, which do not follow this rule o terminals supporting a large number of colors are limited by the number of color pairs that can be represented in a signed short value. COLORS After initializing curses, this variable contains the number of colors which the terminal can support. COLS After initializing curses, this variable contains the width of the screen, i.e., the number of columns. ESCDELAY This variable holds the number of milliseconds to wait after reading an escape character, to distinguish between an individual escape char- acter entered on the keyboard from escape sequences sent by cursor- and function-keys (see curses(3X). LINES After initializing curses, this variable contains the height of the screen, i.e., the number of lines. TABSIZE This variable holds the number of columns used by the curses library when converting a tab character to spaces as it adds the tab to a win- dow (see curs_addch(3X). The Current Screen This implementation of curses uses a special window curscr to record its updates to the terminal screen. The New Screen This implementation of curses uses a special window newscr to hold updates to the terminal screen before applying them to curscr. The Standard Screen Upon initializing curses, a default window called stdscr, which is the size of the terminal screen, is created. Many curses functions use this window. NOTES
The curses library is initialized using either initscr(3X), or newterm(3X). If curses is configured to use separate curses/terminfo libraries, most of these variables reside in the curses library. PORTABILITY
ESCDELAY and TABSIZE are extensions, not provided in most other implementations of curses. SEE ALSO
ncurses(3NCURSES), threads(3NCURSES), terminfo_variables(3NCURSES), terminfo(3X), terminfo(5). curses_variables(3NCURSES)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy