newCDKLabel, setCDKLabel, setCDKLabelMessage, getCDKLabelMessage,
setCDKLabelBox, getCDKLabelBox, setCDKLabelULChar,
setCDKLabelURChar, setCDKLabelLLChar, setCDKLabelLRChar,
setCDKLabelVerticalChar, setCDKLabelHorizontalChar,
setCDKLabelBoxAttribute, setCDKLabelBackgroundColor,
drawCDKLabel, eraseCDKLabel, destroyCDKLabel, waitCDKLabel
- Creates a managed curses label widget.
cc [ flag ... ] file ... -lcdk [ library ... ]
#include <cdk.h>
CDKLABEL *newCDKLabel (CDKSCREEN *cdkscreen, int xpos, int
ypos, char **message, int messageLines, boolean box,
boolean shadow);
void setCDKLabel (CDKLABEL *label, char **message, int
messageLines, boolean box);
void setCDKLabelMessage (CDKLABEL *label, char **message,
int messageLines);
chtype **getCDKLabelMessage (CDKLABEL *label int *message-
Lines);
void setCDKLabelBox (CDKLABEL *label, boolean box);
boolean getCDKLabelBox (CDKLABEL *label);
void setCDKLabelULChar (CDKLABEL *,label, chtype charac-
ter);
void setCDKLabelURChar (CDKLABEL *,label, chtype charac-
ter);
void setCDKLabelLLChar (CDKLABEL *,label, chtype charac-
ter);
void setCDKLabelLRChar (CDKLABEL *,label, chtype charac-
ter);
void setCDKLabelVerticalChar (CDKLABEL *,label, chtype
character);
void setCDKLabelHorizontalChar (CDKLABEL *,label, chtype
character);
void setCDKLabelBoxAttribute (CDKLABEL *,label, chtype
character);
void setCDKLabelBackgroundColor (CDKLABEL *,label, char *
color);
void moveCDKLabel (CDKLABEL *label, int box, int box,
boolean relative, boolean refresh);
void positionCDKLabel (CDKLABEL *label);
void drawCDKLabel (CDKLABEL *label, boolean box);
void eraseCDKLabel (CDKLABEL *label);
void destroyCDKLabel (CDKLABEL *label);
void waitCDKLabel (CDKLABEL *label, char key);
The Cdk label widget creates a pop-up label window. The
following are functions which create or manipulate the Cdk
label widget.
CDKLABEL *newCDKLabel (CDKSCREEN *screen, int xpos, int
ypos, char **message, int messageLines, boolean box,
boolean shadow);
This function creates a pointer to a label widget. The
screen parameter is the screen you wish this widget to
be placed in. The parameter xpos controls the placement
of the object along the horizontal axis. This parameter
can accept an integer value or one of the pre-defined
values of LEFT, RIGHT, and CENTER. The parameter ypos
controls the placement of the object along the vertical
axis. This parameter can accept an integer value or one
of the pre-defined values of TOP, BOTTOM, and CENTER.
The message parameter is the message to be displayed in
the window. The message can accept the full compliment
of the standard Cdk display format commands. To learn
more about this read the cdk_display manual page. The
parameter rows is the number of message rows that were
passed in on the message parameter. The box parameter
states whether the widget will be drawn with a box
around it or not. The shadow parameter accepts a
boolean value to turn the shadow on or off around this
widget. If the widget could not be created then a NULL
pointer is returned.
void setCDKLabel (CDKLABEL *label, char **message, int
messageLines, boolean box);
This function allows the user to change the contents of
the label widget. The parameters are the same as the
newCDKLabel.
void setCDKLabelMessage (CDKLABEL *label, char **message,
int messageLines);
This sets the contents of the label widget.
chtype **getCDKLabelMessage (CDKLABEL *label, int *mes-
sageLines);
This returns the contents of the label widget. The
parameter messageLines is an integer pointer which will
be given the number of messageLines passed back.
void setCDKLabelBox (CDKLABEL *label, boolean boxWidget);
This sets whether or not the widget will be draw with a
box around it.
boolean getCDKLabelBox (CDKLABEL *label);
This returns whether or not the widget will be drawn
with a box around it.
void setCDKLabelULChar (CDKLABEL *label, chtype charac-
ter);
This function sets the upper left hand corner of the
widgets box to the given character.
void setCDKLabelURChar (CDKLABEL *label, chtype charac-
ter);
This function sets the upper right hand corner of the
widgets box to the given character.
void setCDKLabelLLChar (CDKLABEL *label, chtype charac-
ter);
This function sets the lower left hand corner of the
widgets box to the given character.
void setCDKLabelLRChar (CDKLABEL *label, chtype charac-
ter);
This function sets the lower right hand corner of the
widgets box to the given character.
void setCDKLabelVerticalChar (CDKLABEL *label, chtype
character);
This function sets the vertical drawing character for
the box to the given character.
void setCDKLabelHorizontalChar (CDKLABEL *label, chtype
character);
This function sets the horizontal drawing character for
the box to the given character.
void setCDKLabelBoxAttribute (CDKLABEL *label, chtype
attribute);
This function sets the attribute of the box.
void setCDKLabelBackgroundColor (CDKLABEL *label, char
*color);
This sets the background color of the widget. The
parameter color is in the format of the Cdk format
strings. To get more information look at the cdk_dis-
play manual page.
void moveCDKLabel (CDKLABEL *label, int xpos, int ypos,
boolean relative, boolean refresh);
This function moves the given widget to the given position.
The parameters xpos and ypos is the new position
of the widget. The parameter xpos can accept an integer
value or one of the pre-defined values of TOP, BOTTOM,
and CENTER. The parameter ypos can accept an integer
value or one of the pre-defined values of LEFT, RIGHT,
and CENTER. The parameter relative states whether the
xpos/ypos pair is a relative move or an absolute move.
For example if xpos = 1 and ypos = 2 and relative =
TRUE, then the widget would move one row down and two
columns right. If the value of relative was FALSE then
the widget would move to the position (1,2). Do not use
the values of TOP, BOTTOM, LEFT, RIGHT, or CENTER when
relative = TRUE. (weird things may happen). The final
parameter refresh is a boolean value which states
whether the widget will get refreshed after the move or
not.
void positionCDKLabel (CDKLABEL *label);
This function allows the user to move the widget around
the screen via the cursor/keypad keys. The following
key bindings can be used to move the widget around the
screen.
Key Bindings
Key Action
Up Arrow Moves the widget up one line.
Down Arrow Moves the widget down one line.
Left Arrow Moves the widget left one column
Right Arrow Moves the widget right one column
Keypad-1 Moves the widget down one line
and left one column.
Keypad-2 Moves the widget down one line.
Keypad-3 Moves the widget down one line
and right one column.
Keypad-4 Moves the widget left one column
Keypad-5 Centers the widget both vertically
and horizontally.
Keypad-6 Moves the widget right one column
Keypad-7 Moves the widget up one line
and left one column.
Keypad-8 Moves the widget up one line.
Keypad-9 Moves the widget up one line
and right one column.
t Moves the widget to the top of the screen.
b Moves the widget to the bottom of the screen.
l Moves the widget to the left of the screen.
r Moves the widget to the right of the screen.
c Centers the widget between the left and
right of the window.
C Centers the widget between the top and
bottom of the window.
Escape Returns the widget to it's original position.
Return Exits the function and leaves the widget
where it was.
Keypad means that if the keyboard you are using has
a keypad, then the Num-Lock light has to be on in
order to use the keys as listed. (The numeric keys
at the top of the keyboard will work as well.)
void drawCDKLabel (CDKLABEL *label, boolean box);
This function draws the label widget on the
screen. The box option draws the widget with or
without a box.
void eraseCDKLabel (CDKLABEL *label);
This function removes the widget from the screen.
This does NOT destroy the widget.
void destroyCDKLabel (CDKLABEL *label);
This function removes the widget from the screen
and frees up any memory the object may be using.
void waitCDKLabel (CDKLABEL *label, chtype key);
This function will wait for a user to press a
key, then carry on. The label parameter is the
pointer to a label widget, while key is the key
to wait for. If no specific key is desired then
pass in (char )NULL.
cdk(3), cdk_binding(3), cdk_display(3), cdk_screen(3)
The header file <cdk.h> automatically includes the header
files <curses.h>, <stdlib.h>, <string.h>, <ctype.h>,
<unistd.h>, <dirent.h>, <time.h>, <errno.h>, <pwd.h>,
<grp.h>, <sys/stat.h>, and <sys/types.h>. The <curses.h>
header file includes <stdio.h> and <unctrl.h>.
If you have Ncurses installed on your machine add
-DNCURSES to the compile line to include the Ncurses
header files instead.
[ Back ] |