Annotation of 43BSDTahoe/new/X/man/man3/xtext.3x, revision 1.1.1.1

1.1       root        1: .TH XTEXT 3X "April 10 1986" "X Version 10"
                      2: .SH NAME
                      3: Xtext \- routines to provide simple text output windows
                      4: .SH SYNOPSIS
                      5: .nf
                      6: .B #include <X/Xtext.h>
                      7: .PP
                      8: .fi
                      9: .B TextWindow *TextCreate(width, height, x, y, parent, 
                     10: .br
                     11: .B             fontname, bwidth, fgpixel, bgpixel,
                     12: .br
                     13: .B             bordercolor, fastscroll);
                     14: .br
                     15: .B int height, width, x, y,
                     16: .B bwidth, fgpixel, bgpixel, fastscroll;
                     17: .nf
                     18: .B Window parent;
                     19: .B char *fontname;
                     20: .B Pixmap bordercolor;
                     21: .PP
                     22: .B TextDestroy(t);
                     23: .B TextWindow *t;
                     24: .PP
                     25: .B TextClear(t);
                     26: .B TextWindow *t;
                     27: .PP
                     28: .B TextRedisplay(t);
                     29: .B TextWindow *t;
                     30: .PP
                     31: .B int TextEvent(t, e);
                     32: .B TextWindow *t;
                     33: .B XEvent *e;
                     34: .PP
                     35: .B TextPutString(t, str);
                     36: .B TextWindow *t;
                     37: .B char *str;
                     38: .PP
                     39: .B TextPutChar(t, ch);
                     40: .B TextWindow *t;
                     41: .B char ch;
                     42: .PP
                     43: .fi
                     44: .B TextPrintf(t, format
                     45: .B  [ , arg ] ... )
                     46: .nf
                     47: .B TextWindow *t;
                     48: .B char *format;
                     49: .PP
                     50: .B TextFlush(t);
                     51: .B TextWindow *t;
                     52: .SH DESCRIPTION
                     53: These functions provide a simple interface to text output windows.
                     54: .PP
                     55: .I TextCreate
                     56: creates a window that is
                     57: .I width
                     58: characters wide and
                     59: .I height
                     60: characters high.  It is located with its upper left hand corner located
                     61: at the point
                     62: .I x, y
                     63: in the window
                     64: .I parent.
                     65: The foreground (i.e. the characters) is in the color
                     66: .I fgpixel
                     67: and the background is the color
                     68: .I bgpixel.
                     69: The border is
                     70: .I bwidth
                     71: pixels wide and filled with the Pixmap
                     72: .I bordercolor.
                     73: If
                     74: .I fastscroll
                     75: is nonzero, text containing multiple newlines is displayed with a single
                     76: jump scroll rather than with a single scroll for each newline.
                     77: .PP
                     78: The structure
                     79: .I TextWindow
                     80: is defined in
                     81: \fI/usr/include/X/Xtext.h\fP.
                     82: The only field that should be of interest to most applications is
                     83: .I w,
                     84: the X Window id of the created window.  This is quite useful if the
                     85: application wishes to map the created window.
                     86: .PP
                     87: .I TextDestroy
                     88: destroys the window described by its argument.  The window is also
                     89: destroyed automatically if the process creating it is terminated.
                     90: .PP
                     91: .I TextClear
                     92: clears the window described by its argument.
                     93: .PP
                     94: .I TextRedisplay
                     95: redisplays the window described by its argument.  If the argument
                     96: is NULL, all active text windows are redisplayed.
                     97: .PP
                     98: .I TextEvent
                     99: handles the event passed to it.  It returns 0 if it was an event
                    100: the library knows how to deal with, and 1 if it was an event of an
                    101: unknown type; the latter should only happen if the application has
                    102: changed the event mask for the window.  Any event that the application
                    103: receives that has as its
                    104: .I window
                    105: the window id of the text window should be passed to
                    106: .I TextEvent
                    107: for handling.  Scrolling text generates an event per line of events, so the
                    108: application should check for them frequently.  An alternative routine,
                    109: .I TextFlush,
                    110: can be used to handle all outstanding events for all active text windows.
                    111: .PP
                    112: .I TextPutString
                    113: prints its string in its window.  The character '\\n' (newline) is
                    114: treated specially, and any other character is taken from the font.
                    115: If the string contains multiple newlines, a single scroll is done for
                    116: each line unless the
                    117: .I fastscroll
                    118: argument was non-zero in the call to
                    119: .I TextCreate.
                    120: .PP
                    121: .I TextPutChar
                    122: is similar to
                    123: .I TextPutString
                    124: but only prints a single character.  Again, newline is treated
                    125: specially.
                    126: .PP
                    127: .I TextPrintf
                    128: is similar to the standard function
                    129: .I printf
                    130: except that it prints its result in the specified window.  The
                    131: resulting string is passed to
                    132: .I TextPutString.
                    133: See also the 
                    134: .B BUGS
                    135: section at the end of this page.
                    136: .PP
                    137: .I TextFlush
                    138: is analogous to the stdio function
                    139: .I fflush
                    140: in that it causes all outstanding output requests to be flushed
                    141: to the specified window.  If the argument is NULL, all windows are
                    142: flushed.  For novice X developers, this routine
                    143: eliminates the need for event handling from X applications.
                    144: .SH "SEE ALSO"
                    145: printf(3S), xterm(1), X(8C)
                    146: .SH AUTHORS
                    147: Paul Asente, Stanford University; Mark Colan, MIT Project Athena/IBM
                    148: .SH BUGS
                    149: \fITextPrintf\fP will truncate the output if the resulting string is more than
                    150: 2048 characters long.
                    151: .PP
                    152: Since X operates asynchronously, it is possible to get way ahead of the
                    153: server.  This means that it may be quite a while between when a scroll
                    154: happens on the screen and when \fIXtext\fP gets around to filling in areas
                    155: that couldn't be scrolled normally.  This should only happen if the
                    156: application issues a great many output requests very quickly, or if it
                    157: doesn't get around to receiving the events \fIXtext\fP needs to fill these
                    158: areas in.  Also, some strange TCP bugs are invoked if an application
                    159: which has gotten far ahead of the X server is stopped (as with a
                    160: control-Z).

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.