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

πŸ’– XmListItemPos πŸ’–

okay bestie, gather round, because today we're talking about XmListItemPos β€” a library call straight out of the Motif-verse, and she's here to answer exactly one question: where in the list is this thing?? πŸ¦‹


✨ NAME ✨

XmListItemPos β€” a List function that returns the position of an item in the list. that's it. that's her whole job. and she ate. πŸ’…


🌸 SYNOPSIS 🌸

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

yes the indentation is giving "I wrote this in 1994 and I stand by it" but we move. 🫢


πŸŽ€ DESCRIPTION πŸŽ€

So like, XmListItemPos returns the position of the first instance of the specified item in a list. Note the first β€” if your item is out here living its duplicate era and showing up multiple times, she's reporting on the earliest one only. no cap. ⭐

  • widget β€” Specifies the ID of the List widget. like, which list are we even talking about, bestie? this one. πŸ‘‘
  • item β€” Specifies the item whose position is returned. the main character we're hunting for. πŸ”

For a complete definition of List and its associated resources, see XmList(3). iykyk, go read it, it's the whole lore. πŸ“š


πŸ”₯ RETURN πŸ”₯

Returns the position in the list of the first instance of the specified item.

and the counting starts at 1, not zero, because we are not doing that today:

  • the position of the first item in the list is 1 ✨
  • the position of the second item is 2 ✨
  • and so on, and so on, you get the vibe 🌈
🚨 This function returns 0 (zero) if the item is not found. so if you get a 0 back, that's not a position, that's a sad trombone. item said "not today" and ghosted the list entirely. πŸ’€

  • XmList(3) β€” the source material, the blueprint, the mother. go pay respects. πŸ™‡

and that's the whole page, babe. this was XmListItemPos(library call) β€” that's the title AND the footer, she's wearing the same outfit twice and honestly? iconic. no date, no version, no author credits in sight, just pure unbothered Motif energy. periodt. πŸ’œβœ¨