XMTEXTSETSOURCE(3)
π XmTextSetSource π
okay bestie, so this one is XmTextSetSource(library call) β it lives in the library call manual, and it is literally the glow-up button for your Text widget's source. let's get into it π«Ά
β¨ NAME β¨
XmTextSetSource β a Text function that sets the source of the widget. that's it, that's the whole job description, and she does it flawlessly π
β¨ SYNOPSIS β¨
#include <Xm/Text.h>
void XmTextSetSource(
Widget widget,
XmTextSource source,
XmTextPosition top_character,
XmTextPosition cursor_position);
no cap, that's the whole thing. void return, four args, no drama β¨
β¨ DESCRIPTION β¨
so XmTextSetSource sets the source of the Text widget. and the reason this is iconic? Text widgets can share sources of text, which means editing in one widget is reflected in another. yes bestie, one edit, multiple widgets, synchronized behavior, main character energy π
this function sets the source of one widget so that it can share the source of another widget. that's the whole vibe.
π¨ okay important thing, don't skip this: setting a new text source destroys the old text source if no other Text widgets are using that source. gone. poof. π
and if you want to replace a text source but keep it for later use? the move is: create an unmanaged Text widget and set its source to the text source you want to keep. that's the trick, iykyk π§
now the arguments, one by one:
widgetβ specifies the Text widget ID. your lil guy. the one you're doing this to πsourceβ specifies the source with which the widget displays text. this can be a value returned by theXmTextGetSource(3)function. and if no source is specified, the widget creates a default string source. so like, she'll handle it herself, but you can hand her one πtop_characterβ specifies the position in the text to display at the top of the widget. this is an integer number of characters from the beginning of the text buffer. and listen, the first character position is 0 (zero). not 1. zero. counting from zero is the way πΈcursor_positionβ specifies the position in the text at which the insert cursor is located. this is an integer number of characters from the beginning of the text buffer. and again, the first character position is 0 (zero). same deal, same zero, no exceptions β¨
and for a complete definition of Text and its associated resources, see XmText(3). that's your homework, bestie π
β¨ RELATED β¨
that's the whole page fr fr π¦
XmTextSetSource(library call) β that's the manual name and the footer right there, so consider it shouted from the rooftops. mwah, go share some sources responsibly ππ
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms