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

πŸ’– XmTabListRemoveTabs πŸ’–

okay bestie, so this one lives in the <Xm/Xm.h> header and it's a library call β€” it's XmTabListRemoveTabs, and it is literally the friend who comes over and helps you declutter your tab list. noncontiguous tabs? gone. slay. πŸŽ€


✨ SYNOPSIS ✨

#include <Xm/Xm.h>
XmTabList XmTabListRemoveTabs(
XmTabList oldlist,
Cardinal *position_list,
Cardinal position_count);

like, that's the whole vibe right there. three args, one glow-up. πŸ’…


🌸 DESCRIPTION 🌸

So here's the tea: XmTabListRemoveTabs removes noncontiguous tabs from a tab list. It doesn't mess with your original in place β€” no no. It builds a brand new tab list by copying the contents of oldlist and then yeeting every tab whose corresponding position shows up in the position_list array. new list, who dis. ✨

⚠️ and if one of the positions you asked for is invalid β€” like, say, a value that's a number greater than the number of tabs in the tab list β€” it'll show a warning message. so you will know. no silent failures here, bestie. 😭
  • tablist β€” Specifies the tab list. Heads up though, the function deallocates oldlist and all the tabs it contains after it's done extracting the info it needs. so like… it took what it needed and it left. πŸ’€ (note: the synopsis calls this one oldlist, same energy, don't @ me.)
  • position_list β€” Specifies an array of the tab positions to be removed. And the indexing is giving very much programmer brain: the position of the first tab in the list is 0 (zero, periodt), the position of the second tab is 1, and so on. counting from zero is iconic behavior honestly. πŸ‘‘
  • position_count β€” Specifies the number of elements in the position_list. that's it, that's the whole job. 🫢

πŸ’œ RETURN πŸ’œ

okay so here's the rules, no cap:

  • If oldlist or position_list is NULL, or if position_count is 0 (zero) β€” it just returns oldlist. nothing happened, we stayed home. πŸ™ˆ
  • Otherwise? it returns the new tab list. πŸŽ‰

and now the part you actually need to remember: the function allocates space to hold the returned tab list, and you β€” yes, you, the application β€” are responsible for managing that allocated space. πŸ‘€

You can recover the allocated space by calling XmTabListFree. do not forget to free. that's the whole moral of the story, fr fr. 🧚


go read those too, they're lowkey part of the lore. πŸ’–


and that's a wrap on this one, bestie!! this page came straight out of the XmTabListRemoveTabs(library call) manual β€” that's the title and the footer both, so you know exactly where it lives. now go free your tab lists and your memory. mwah. πŸ’…πŸ¦‹βœ¨