XMDATAFIELDSETSELECTION(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

πŸ’– XmDataFieldSetSelection β€” the library call that claims the primary selection πŸ’–

okay bestie, welcome to XmDataFieldSetSelection(3), a <cyan>library call</cyan> from the Xm/DataField universe. it's giving "I'm gonna take ownership of your highlighted text and I'm gonna be dramatic about it" energy, and honestly? iconic. πŸŽ€


✨ NAME ✨

XmDataFieldSetSelection β€” a DataField function that sets the primary selection of the text. no cap, that's literally its whole job description and it ate. πŸ’…


🌸 SYNOPSIS 🌸

#include <Xm/DataF.h>
void XmDataFieldSetSelection(
Widget widget,
XmTextPosition first,
XmTextPosition last,
Time time);

yes she takes four args and returns absolutely nothing (void, periodt). she does the work and she doesn't need to hand you a receipt. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: XmDataFieldSetSelection sets the primary selection of the text in the widget. like, THE primary selection. the one everybody fights over. she's the main character of your clipboard-adjacent life rn. ✨

and she does not stop there, because why would she:

  • she also sets the insertion cursor position to the last position of the selection πŸ‘‘
  • and she calls the widget's XmNmotionVerifyCallback callbacks πŸ“ž

also, XmDataFieldSetSelection always generates an XmNgainPrimaryCallback β€” unless it fails to take ownership of the primary text selection. so if she fumbles the bag, no callback for you. πŸ’€ that's the one exception and you need to know it.

now let's do the args, one by one, because we respect the args in this house:

  • widget β€” specifies the DataField widget ID. this is the lil guy you're doing all of this to. πŸ₯Ί
  • first β€” marks the first character position of the text to be selected. the opening act. 🎬
  • last β€” marks the last position of the text to be selected. the grand finale. 🌟
  • time β€” specifies the time at which the selection value is desired. it should be the same as the time of the event that triggered this request. one source of a valid time stamp is the function XtLastTimestampProcessed. so like, don't just make up a time, bestie, grab it from the actual event. πŸ™ˆ
lowkey important: that time thing isn't a vibe, it's a requirement β€” it should match the event's time. one valid source is XtLastTimestampProcessed. ✨

and if you want the complete definition of DataField and all its associated resources, go read XmDataField(3). it's the extended lore. πŸ“š



πŸ’œ sign-off πŸ’œ

and that's the whole page, bestie!! this was XmDataFieldSetSelection(library call) β€” the footer said so, and we trust the footer. no date, no version drama, just vibes, primary selection ownership, and one very important callback. go forth and select some text. slay. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά