Table 8-2. Textsw_action Attributes (continued)
Attribute
(TEXTSW_ACTION_ . . . )
Type Description
EDITED_MEMORY (no value) Monitors whether an empty text subwindow has
been edited.
FILE_IS_READONLY char * The file named by the provided string value does
not have write permission.
LOADED_FILE char * The text subwindow is being used to view the
file named by the provided string value.
TOOL_CLOSE
(no value) The frame containing the text subwindow should
become iconic.
TOOL_DESTROY
Event * The tool containing the text subwindow should
exit, without checking for a veto from other
subwindows. The value is the user action that
caused the destroy.
TOOL_QUIT Event * The tool containing the text subwindow should
exit normally. The value is the user action that
caused the exit.
TOOL_MGR Event * The tool containing the text subwindow should
do the window manager operation associated
with the provided event value.
USING_MEMORY (no value) The text subwindow is being used to edit a string
stored in primary memory, not a file.
The attribute TEXTSW_ACTION_EDITED_FILE is a slight misnomer, as it is given to the notify
procedure after the first edit to any text, whether or not it came from a file. This notification
happens only once per session of edits, whereas, on the other hand, notification of
TEXTSW_ACTION_LOADED_FILE is considered to terminate the old session and start a new
one.
NOTE
The attribute TEXTSW_ACTION_LOADED_FILE must be treated very carefully
because the notify procedure gets called with this attribute in several situations:
after a file is initially loaded, after any successful “Save Current File” menu
operation, after an “Undo All Edits” menu operation, and during successful calls
to textsw_reset(), textsw_save(), and textsw_store().
Text Subwindows
Text Subwindows 235
The appropriate response by the procedure is to interpret these notifications as being equiva-
lent to:
The text subwindow is displaying the file named by the provided string value; no
edits have been performed on the file yet. In addition, any previously displayed
or edited file has been either reset, saved, or stored under another name.
8.12.1 Text Subwindow Interposition
If you need to interpose on a text subwindow, get the text subwindow’s view window and
interpose on it.
Xv_Window window;
Textsw textsw;
int win_no;
window = (Xv_Window)xv_get(textsw, OPENWIN_NTH_VIEW, win_no);
For more information on registering events for text subwindows, see Section 6.3, “Register-
ing Events;” for more information on interposition, refer to Section 20.9, “Interposition.”
8.13 Text Subwindow Package Summary
Table 8-3 lists the procedures and macros for the TEXTSW. Table 8-4 lists the attributes for
the TEXTSW package. This information is described fully in the XView Reference Manual.
Table 8-3. Text Subwindow Procedures and Macros
Procedures and Macros
textsw_add_mark() textsw_next()
textsw_append_file_name() textsw_normalize_view()
textsw_delete() textsw_notify_proc()
textsw_edit() textsw_possibly_normalize()
textsw_erase() textsw_remove_mark()
textsw_file_lines_visible() textsw_replace_bytes()
textsw_find_bytes() textsw_reset()
textsw_find_mark() textsw_save()
textsw_first() textsw_screen_line_count()
textsw_index_for_file_line() textsw_scroll_lines()
textsw_insert() textsw_set_selection()
textsw_match_bytes() textsw_store_file()
236 XView Programming Manual
Table 8-4. Text Subwindow Attributes
TEXTSW_AGAIN_RECORDING TEXTSW_IGNORE_LIMIT
TEXTSW_AUTO_INDENT TEXTSW_INSERT_FROM_FILE
TEXTSW_AUTO_SCROLL_BY TEXTSW_INSERT_MAKES_VISIBLE
TEXTSW_BLINK_CARET TEXTSW_INSERTION_POINT
TEXTSW_BROWSING TEXTSW_LENGTH
TEXTSW_CHECKPOINT_FREQUENCY TEXTSW_LINE_BREAK_ACTION
TEXTSW_CLIENT_DATA TEXTSW_LOWER_CONTEXT
TEXTSW_CONFIRM_OVERWRITE TEXTSW_MEMORY_MAXIMUM
TEXTSW_CONTENTS TEXTSW_MULTI_CLICK_SPACE
TEXTSW_CONTROL_CHARS_USE_FONT TEXTSW_MULTI_CLICK_TIMEOUT
TEXTSW_DESTROY_VIEW TEXTSW_NOTIFY_PROC
TEXTSW_DISABLE_CD TEXTSW_READ_ONLY
TEXTSW_DISABLE_LOAD TEXTSW_STATUS
TEXTSW_EDIT_COUNT TEXTSW_STORE_CHANGES_FILE
TEXTSW_EXTRAS_CMD_MENU TEXTSW_SUBMENU_EDIT
TEXTSW_FILE TEXTSW_MODIFIED
TEXTSW_FILE_CONTENTS TEXTSW_SUBMENU_FILE
TEXTSW_FIRST TEXTSW_SUBMENU_FIND
TEXTSW_FIRST_LINE TEXTSW_SUBMENU_VIEW
TEXTSW_FONT TEXTSW_UPPER_CONTEXT
TEXTSW_HISTORY_LIMIT
XV_LEFT_MARGIN XV_RIGHT_MARGIN
Text Subwindows
Text Subwindows 237
This page intentionally left blank
to preserve original page counts.

Get Volume 7A: XView Programming Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.