DTEDITORCHANGE(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

DtEditorChange πŸ’…

okay so this is a library call β€” that’s the manual name, bestie, DtEditorChange(library call) energy β€” and it’s literally all about changing strings inside a DtEditor widget. no cap, she’s iconic ✨


✨ NAME ✨

DtEditorChange β€” change one or all occurrences of a string in a DtEditor widget 🌸

🌸 SYNOPSIS 🌸

#include &<Dt/Editor.h>
Boolean DtEditorChange(
Widget widget,
DtEditorChangeValues *findChangeStrings,
unsigned int instanceToChange);

πŸ’– DESCRIPTION πŸ’–

DtEditorChange swaps out the next occurrence of a string, all occurrences of the string, or the currently selected text in a DtEditor widget with a replacement string. The string to search for and the value to change it to can be the last values entered in the Find/Change dialog (peep DtEditorInvokeFindChangeDialog(3)) or passed as arguments to DtEditorChange.

The search starts at the insertion cursor. If the string isn’t found by the time the end of the document is reached, the search continues at the beginning of the document, stopping at the character before the insertion cursor. It’s giving wrap-around hunt, and honestly? Obsessed. πŸŽ€

widget is the DtEditor widget ID β€” that’s your main character widget. findChangeStrings is the string to change plus the replacement value. If findChangeStrings is NULL, DtEditorChange uses the last string specified in the Find and Change To fields of the Find/Change dialog. And if instanceToChange is DtEDITOR_CURRENT_SELECTION, the Find field of DtEditorChangeValues is ignored. Yes, the manpage says that ignored-Find-field thing twice β€” it’s clearly a big deal πŸ’…

instanceToChange is the switch that decides the vibe:

  • DtEDITOR_NEXT_OCCURRENCE β€” replaces the next occurrence (relative to the insertion cursor) of the find string.
  • DtEDITOR_ALL_OCCURRENCES β€” changes all instances of the find string.
  • DtEDITOR_CURRENT_SELECTION β€” the Find field of DtEditorChangeValues is ignored, and the currently selected text is replaced.

For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3). For a complete definition of DtEditorChangeValues, see Dt/Editor.h - DtEditor(5).

πŸŽ€ RETURN VALUE πŸŽ€

Upon successful completion, DtEditorChange returns True if the substitution occurred; otherwise, it returns False. Binary slay β€” yes or no, no maybes ✨

πŸ¦‹ SEE ALSO πŸ¦‹

β€” source/version: DtEditorChange(library call); date: not listed in this footer, and honestly she’s timeless. bye bestie πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from