XMTEXTXYTOPOS(3)
π XmTextXYToPos β a lil library call from the Text girlies π
okay so bestie, we're in the library call section of the manual, and today's main character is XmTextXYToPos from the XmText fam. pull up a chair, grab a boba, and let's get into it π§β¨
β¨ NAME β¨
XmTextXYToPos β a Text function that accesses the character position nearest an x and y position π
like. it's the "which letter am I hovering over" girlie. she does one job and she does it flawlessly. periodt.
π SYNOPSIS π
#include <Xm/Text.h>
XmTextPosition XmTextXYToPos(
Widget widget,
Position x,
Position y);
yes, that's the whole thing. three args. no drama. no cap. π¦
πΈ DESCRIPTION πΈ
so XmTextXYToPos accesses the character position nearest to the specified x and y position, relative to the upper left corner of the Text widget. like, upper left is home base, that's where we start counting from, always π
and here's the tea about orientation, because she's bilingual in writing directions:
- in the case of horizontal writing, the position is the origin of the character.
- in the case of vertical writing, the position is the vertical origin of the character.
so whichever way your text is vibing, she knows where the "start" of that character lives. she's not confused. she's never confused. π
the arguments, one by one π«
widgetβ specifies the Text widget ID. this is your girl, the widget you're asking about π«Άxβ specifies the x position, relative to the upper left corner of the widget.yβ specifies the y position, relative to the upper left corner of the widget.
heads up bestie: for a complete definition of Text and its associated resources, see XmText(3). that's the deep lore page, this one's just the little spotlight moment β¨
π₯ RETURN π₯
she returns the character position in the text nearest the x and y position specified. and ngl that's an integer number of characters from the beginning of the buffer.
and listen β the first character position is 0 (zero). zero-indexed, like a true programmer. not me being shocked, we been knew ππ
π RELATED π
lowkey remember: this is a function, not a macro, so she's got a real return value, and that return value is a XmTextPosition. treat her right and she'll tell you exactly which character you're pointing at π
okay that's the whole page, you ate that, I ate that, we all ate π and for the lil sign-off: this was XmTextXYToPos from the library call manual, sourced straight from the XmText corner of the docs β mwah, sending you and your widget nothing but good vibes ππβ¨
π¦ 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