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

πŸ’– NAME πŸ’–

XmListReplacePositions β€” a List function that replaces items in a list based on position, and honestly? she's giving "surgical glow-up for your list" energy ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <Xm/List.h>
void XmListReplacePositions(
Widget widget,
int *position_list,
XmString *item_list,
int item_count;);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay bestie, so XmListReplacePositions swaps out noncontiguous items in a list. Noncontiguous, meaning they do not have to be all next to each other β€” you can glow up item 2 and item 47 in the same breath, no problem πŸ’…

The item sitting at each position you name in position_list gets replaced by the matching entry in item_list. So it's a lil one-to-one, position-by-position kinda deal. Matching up, slay.

Here's the part you need to know: when the items get inserted into the list, they get compared against the current XmNselectedItems list. Any of the new items that match items on the selected list will appear selected. So like, they walk in already wearing the selection fit πŸ‘‘

⚠️ And now the vibe check: a warning message is displayed if a specified position is invalid. Invalid means the value is 0 (zero), a negative integer, or a number greater than the number of items in the list. So don't do that. Fr fr. πŸ™ˆ
  • widget β€” Specifies the ID of the List widget. Like, which list are we doing surgery on? This one. 🫢
  • position_list β€” Specifies an array of the positions of items to be replaced. Counting starts at 1, bestie: the position of the first item in the list is 1; the position of the second item is 2; and so on. Not zero-indexed, don't come at me. 🌸
  • item_list β€” Specifies an array of the replacement items. These are the new fits going in. ✨
  • item_count β€” Specifies the number of elements in position_list and item_list. This number must be nonnegative. That's the rule. Periodt. πŸ’€

For a complete definition of List and its associated resources, see XmList(3).



and that's the whole page, babe β€” no cap, that's everything she said πŸ’œ

this lil manual page is XmListReplacePositions(library call), from the library call crew β€” go off, read the related one too, iykyk πŸ§šπŸ“