Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Fast Alpha/Font Manager Programmer's Manual: HP 9000 Series 700 Computers > Chapter 2 The Fast Alpha Library

Cursor Control

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

You can display and move a cursor using the Fast Alpha Library. The facursor routine is used for cursor control operations.

Procedure

To move and/or turn the cursor on or off, call facursor.

facursor(gfd,
column, line, cflag)

The column and line parameters specify the column and line at which to position the cursor; the top line of the display is line 0, and the leftmost column is column 0. If either column or line is invalid (or equals FACURSORNOMOVE), the cursor's position is not updated.

The cflag parameter determines whether or not the cursor is displayed. If cflag is TRUE, the cursor is displayed; if FALSE, the cursor is turned off. Turning the cursor on or off doesn't in itself change the cursor position as Fast Alpha remembers it.

If you specify invalid coordinates for column and line — specifically, FACURSORNOMOVE as defined in fa.h — the cursor won't move, but cflag is still effective. This is useful if you wish to turn on/off the cursor at its current position.

If part of the window is off screen, the desired cursor position may also be off screen. For example, if the upper-left corner of the window is off screen, 0,\thinspace{}0 are valid cursor coordinates, but the cursor is not visible; it is off screen.

Also, you can specify a cursor position that might be occluded by windows higher up in the display stack.

Precautions

The cursor is actually a displayable character taken from the currently active font. Therefore, if no font is activated, the cursor is automatically turned off. Attempting to turn the cursor on when no font is active results in an error.

Examples

The following program turns on the cursor at column 27 and line 12. It pauses for 3 seconds and then turns off the cursor. The actual path names of directories in angle brackets depend on the file system structure. See the Graphics Administration Guide for details.

#include <fa.h>                         /* get Fast Alpha defs        */
#include <starbase.c.h> /* get starbase defs */

main() /* program "Cursor.c" */
{
int gfd; /* file descriptors */

/* open the device or window */
if ((gfd = gopen("〈screen〉/window", OUTDEV, NULL, INIT)) == -1)
exit(1);

fainit(gfd, FAWINDOW); /* initialize the Fast Alpha env. */

facursor(gfd, 27,12, TRUE);
sleep(3);
facursor(gfd, FACURSORNOMOVE, FACURSORNOMOVE, FALSE);

faterminate(gfd); /* terminate the environment */
gclose(gfd); /* close the device */
}
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1995 Hewlett-Packard Development Company, L.P.