XtSetSelectionParameters(3)

✨ XtSetSelectionParameters ✨

okay bestie, so this one is from the XT FUNCTIONS corner of libXt β€” it's XtSetSelectionParameters, and it's literally the little pre-game ritual you do before you ask for a selection. πŸ’…


πŸ’– NAME πŸ’–

XtSetSelectionParameters β€” specify target parameters for a selection request with a single target. periodt. 🎯


🌸 SYNTAX 🌸

#include <X11/Intrinsic.h>

void XtSetSelectionParameters(Widget requestor, Atom selection, Atom
       type, XtPointer value, unsigned long length, int format);

no cap, that's the whole signature. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • requestor β€” the widget that's making the request. it must be of class Core or any subclass of it, fr fr. like if it's not Core-flavored, we can't do this.
  • selection β€” the atom that names the selection you're going after. πŸ¦‹
  • type β€” the type of the property that your parameters are gonna get passed around in.
  • value β€” a pointer to the parameters themselves. this is your content, your moment. ✨
  • length β€” how many elements of data live in value, and each element is sized according to format.
  • format β€” the size in bits of the data in the elements of value. it's giving very specific.

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: the parameters you specified get copied and stored in a brand-new property of the specified type and format, sitting pretty on the requestor's window. πŸ’–

then, to actually kick off a selection request with a target plus these parameters, you make a subsequent call to XtGetSelectionValue or XtGetSelectionValueIncremental with the same requestor widget and selection atom β€” that's what generates a ConvertSelection request referring referring to the property containing the parameters. (yes, "referring referring" β€” that's what the page says, i don't make the rules, i just report them 😭)

and lowkey important: if you call XtSetSelectionParameters more than once with the same widget and selection, without a call to specify a request in between, then the most recently specified parameters are the ones used in the subsequent request. newest wins, always. πŸ‘‘

the possible values of format may be 8, 16, or 32. if the format is 8, the elements of value are assumed to be sizeof(char); if 16, sizeof(short); if 32, sizeof(long). those three, that's the whole menu, don't try anything else. 🚫

now for the MULTIPLE target situation β€” if you wanna generate a MULTIPLE target request with parameters for any of the multiple targets of the selection request, here's the choreography:

  1. precede individual calls to XtGetSelectionValue and XtGetSelectionValueIncremental with corresponding individual calls to XtSetSelectionParameters
  2. and enclose these all within XtCreateSelectionRequest and XtSendSelectionRequest

that's the whole dance. πŸ’ƒ

⚠️ heads up bestie: XtGetSelectionValues and XtGetSelectionValuesIncremental cannot be used to make selection requests with parameterized targets. like, at all. not a vibe. sorry. πŸ’€

🌈 SEE ALSO 🌈


mwah πŸ’‹ that's the whole page β€” brought to you by X Version 11, libXt 1.3.1, and the date on the original footer. go slay your selection requests, bestie, you've got this πŸ‘‘βœ¨

πŸ“¦ where this page comes from