DTEDITORAPPEND(3)
π NAME π
DtEditorAppend β append data to a DtEditor widget. This is the (library call) manual entry for DtEditorAppend, bestie, and itβs here to explain exactly how to tack data onto the end of a DtEditor widget π
β¨ SYNOPSIS β¨
#include &<Dt/Editor.h>
DtEditorErrorCode DtEditorAppend(
Widget widget,
DtEditorContentRec *data);
πΈ DESCRIPTION πΈ
Okay so the DtEditorAppend function appends either a NULL-terminated string, a wide character string, or a sized buffer after the last character in a DtEditor widget. The data gets transferred to the DtEditor widget using a DtEditorContentRec, which tells you the type of data being transferred along with the actual data. After the data is appended, the insertion cursor is positioned at the new last character β¨
The widget argument specifies the DtEditor widget ID.
The data argument points to the data structure containing the data to append.
For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3).
For a complete definition of DtEditorContentRec, see Dt/Editor.h - DtEditor(5).
π RETURN VALUE π
Upon successful completion, the DtEditorAppend function returns one of the following values:
DtEDITOR_NO_ERRORSβ the data was appended sucessfully.DtEDITOR_NULLS_REMOVEDβNULLcharacters were found and removed from the data.
Otherwise, if the DtEditorAppend function cannot append the data into the DtEditor widget, it returns one of the following values:
DtEDITOR_INVALID_TYPEβ thetypefield is unrecognized.DtEDITOR_ILLEGAL_SIZEβ the size of the buffer passed in is negative.DtEDITOR_NULL_ITEMβ the buffer isNULL.DtEDITOR_INSUFFICIENT_MEMORYβ not enough system memory is available to append the data.
π EXAMPLES π
The following code segment sets the contents of a DtEditor widget to βThe quick brown fox.β
Widget editor;
DtEditorContentRec cr;
DtEditorErrorCode status;
char *sampleString1="The quick",
*secondString2=" brown fox";
cr.type = DtEDITOR_TEXT;
cr.value.string = sampleString1;
status = DtEditorSetContents(editor, &&cr);
if (status != DtEDITOR_NO_ERRORS &&&& status != DtEDITOR_NULLS_REMOVED) {
printf("Unable to set the contents of the widget0);
} else {
cr.type = DtEDITOR_TEXT;
cr.value.string = sampleString2;
status = DtEditorAppend(editor, &&cr);
if (status != DtEDITOR_NO_ERRORS)
printf("Unable to append to the contents of the widget0);
}
π¦ APPLICATION USAGE π¦
If the data is in a disk file, rather than in memory, the application should use DtEditorAppendFromFile(3).
π SEE ALSO π
Dt/Editor.h - DtEditor(5)DtEditor(3)DtEditorAppendFromFile(3)DtEditorGetContents(3)DtEditorInsert(3)DtEditorInsertFromFile(3)DtEditorReplace(3)DtEditorReplaceFromFile(3)DtEditorSaveContentsToFile(3)DtEditorSetContents(3)DtEditorSetContentsFromFile(3)
okay thatβs the whole page, bestie π«Ά the footer gives us DtEditorAppend(library call) β no extra source/version/date crumbs are printed on this one, so thatβs the official cute sign-off π
β¨
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms