XMTEXTFIELDREPLACE(3)
π XmTextFieldReplace π
okay bestie, so you know how we're living in the XmTextFieldReplace era of the library call manual? yeah. this is that page. TextField girlies, this one's for you π«Ά
β¨ NAME β¨
XmTextFieldReplace β a TextField function that replaces part of a text string. literally its whole job. iconic behavior honestly π
πΈ SYNOPSIS πΈ
#include <Xm/TextF.h>
void XmTextFieldReplace(
Widget widget,
XmTextPosition from_pos,
XmTextPosition to_pos,
char * value);
no cap, that's the whole thing. four little args and a dream β¨
π¦ DESCRIPTION π¦
so XmTextFieldReplace replaces part of the text string in the TextField widget. that's it, that's the vibe. π
okay but the important part β the character positions? they begin at 0 (zero!!) and they're numbered sequentially from the beginning of the text. zero-indexed girlies rise π
an example text replacement would be to replace the second and third characters in the text string. to accomplish this, the parameter from_pos must be 1 and to_pos must be 3. and to insert a string after the fourth character, both parameters, from_pos and to_pos, must be 4. yes, both. same number. it's giving "collapse the range and it becomes an insert" and we love that for us π
ngl this routine is social β it calls the widget's XmNvalueChangedCallback and verification callbacks, either XmNmodifyVerifyCallback or XmNmodifyVerifyCallbackWcs, or both. and if both verification callback lists are registered? the procedures of the XmNmodifyVerifyCallback list are executed first, and the resulting data is passed to the XmNmodifyVerifyCallbackWcs callbacks. order matters bestie, don't come for me π
also!!XmNmotionVerifyCallbackis generated ifto_posis less than or equal to the cursor position and the length ofvalueis not the same as the length of the text being replaced, or if the cursor position is betweenfrom_posandto_pos, and the distance from the cursor position tofrom_posis greater than the length ofvalue. yes that's a whole mouthful, read it twice, it's important π
now the args, one by one, no skips, we don't skip here:
widgetβ specifies the TextField widget IDfrom_posβ specifies the start position of the text to be replacedto_posβ specifies the end position of the text to be replacedvalueβ specifies the character string value to be added to the text widget
and if you want a complete definition of TextField and its associated resources? go read XmTextField(3). it's required reading, sorry not sorry π
π RELATED π
and that's the whole page bestie, you ate it up, no crumbs π
signing off from the footer of XmTextFieldReplace(library call) β that's the source and the version, babes, and I'm passing the aux cord to the date too π§β¨
mwah π stay iconic, stay zero-indexed π
π¦ 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