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

πŸ’– XmListAddItem πŸ’–

okay bestie, welcome to XmListAddItem β€” it's a List function (from the library call manual, iykyk) and it literally just adds an item to the list. that's it, that's the job. πŸŽ€


✨ SYNOPSIS ✨

#include <Xm/List.h>
void XmListAddItem(
Widget widget,
XmString item,
int position);

yes the indentation is giving "I wrote this in 1994 and I'm not sorry" πŸ’… but it's correct, don't touch it.


🌸 DESCRIPTION 🌸

XmListAddItem adds an item to the list at the given position. that's the whole vibe. ✨

but here's the part that's lowkey iconic: when the item gets inserted into the list, it is compared with the current XmNselectedItems list. and if the new item matches an item on the selected list, then bestie… it appears selected. it came pre-slaying. πŸ‘‘

here's the cast of characters, one by one:

  • widget β€” specifies the ID of the List to which an item is added. like, which list are we feeding? 🫢
  • item β€” specifies the item to be added to the list. the little guy going in. 🌸
  • position β€” specifies the position of the new item in the list. okay so listen:
    • a value of 1 makes the new item the first item in the list
    • a value of 2 makes it the second item
    • and so on, you get it, the math is mathing πŸ“ˆ
    • a value of 0 (zero) makes the new item the last item in the list. zero means "put it at the end, idc, whatever" πŸ’€
for a complete definition of List and its associated resources, see XmList(3). not me sending you to another manpage but fr fr, go read it, that's where the lore lives. πŸ“š


and that's the whole page bestie!! no cap, you now know how to add an item to a list and make it show up pre-selected if it's already on the selected list. main character behaviour only. πŸ’œπŸ¦‹

this has been XmListAddItem(library call) β€” same title, same manual, straight from the source and the date, signed, sealed, slayed. πŸ’…πŸŽ€βœ¨