XMTEXTPOSTOXY(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmTextPosToXY πŸ’–

okay bestie, welcome to the XmTextPosToXY page from the library call manual β€” yes it's a Text function, and yes it is exactly as iconic as it sounds ✨


🌸 NAME 🌸

XmTextPosToXY β€” a Text function that accesses the x and y position of a character position. like, you give it a spot in the text buffer and it tells you where that spot actually lives on screen. obsessed 🫢


✨ SYNOPSIS ✨

#include <Xm/Text.h>
Boolean XmTextPosToXY(
Widget widget,
XmTextPosition position,
Position *x,
Position *y);

πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the vibe: XmTextPosToXY accesses the x and y position β€” relative to the upper left corner of the Text widget β€” of a given character position in the text buffer. that's it. that's the whole job. and it ate πŸ’…

lowkey important detail: 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. not me making sure you actually read that part 😭

  • widget β€” specifies the Text widget ID. the main character of this whole situation πŸ‘‘
  • position β€” specifies the character position in the text for which the x and y position is accessed. this is an integer number of characters from the beginning of the buffer. and bestie, the first character position is 0 (zero). zero. not one. i said what i said πŸ“
  • x β€” specifies the pointer in which the x position is returned. the returned position is the distance from the left side of the widget to the left border of the character. ⚠️ this value is meaningful only if the function returns True. no cap.
  • y β€” specifies the pointer in which the y position is returned. the returned position is the distance from the top of the widget to the character's baseline. ⚠️ and this one is also meaningful only if the function returns True. fr fr.

for a complete definition of Text and its associated resources, see XmText(3). it's giving required reading πŸ“š


🌈 RETURN 🌈

this function returns True if the character position is displayed in the Text widget; otherwise, it returns False, and no x or y value is returned. like, none. zero. the pointers stay unbothered πŸ’€



and that's the whole page, babe πŸŽ€ this was XmTextPosToXY(library call) β€” yes the footer says the exact same thing as the header, they're matching, it's a set, it's a look πŸ’œ slay, go place some characters and get those coordinates. bye bestie 🫢✨