XMLISTREPLACEITEMS(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 ✨

XmListReplaceItems β€” a List function that replaces the specified elements in the list πŸŽ€


πŸ’… SYNOPSIS πŸ’…

#include <Xm/List.h>
void XmListReplaceItems(
Widget widget,
XmString *old_items,
int item_count,
XmString *new_items);

🌸 DESCRIPTION 🌸

okay bestie, so XmListReplaceItems does exactly what it says on the tin: it replaces each specified item of the list with a corresponding new item. glow-up era fr fr πŸ’–

and here's the lil plot twist πŸ‘€ β€” when the items are inserted into the list, they get compared with the current XmNselectedItems list. so if any of the new items matches an item that's already on the selected list, it appears selected. no extra work needed, she just knows. ✨

  • widget β€” specifies the ID of the List widget. that's your girl, the one you're editing. πŸ‘‘
  • old_items β€” specifies the items to be replaced. the ones getting the makeover. πŸ’…
  • item_count β€” specifies the number of items in old_items and new_items. > this number must be nonnegative. no negativity allowed in this function, periodt. 🚫
  • new_items β€” specifies the replacement items. the new era. the rebrand. the main character entrance. πŸ¦‹

so the way it works is: every occurrence of each element of old_items gets replaced with the corresponding element from new_items. that is, the first element of old_items is replaced with the first element of new_items. the second element of old_items is replaced with the second element of new_items, and so on until item_count is reached. it's a 1:1 match-up, no cap. like pairing up besties for a group photo πŸ“Έ β€” first with first, second with second, and you stop when you run out of people.

and for a complete definition of List and its associated resources, go check out XmList(3). it's giving required reading. πŸ“š



and that's the whole page bestie!! this lil cutie came from the XmListReplaceItems(library call) manual β€” library call energy only, she's a C library function through and through πŸ’œ go forth and replace those items, you absolute icon πŸŒˆβ­πŸ’–