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

✨ XmTabListReplacePositions ✨

okay bestie, welcome to the XmTabListReplacePositions glow-up πŸ’… this one lives in the library call section of the manual, and it's genuinely one of the most useful little functions in Xm/Xm.h β€” it's giving "swap out some tabs and get a whole new list" energy πŸŽ€


🌸 NAME 🌸

XmTabListReplacePositions β€” a convenience function that creates a new tab list with replacement tabs πŸ¦‹


🌈 SYNOPSIS 🌈

#include <Xm/Xm.h>
XmTabList XmTabListReplacePositions(
XmTabList oldlist,
Cardinal *position_list,
XmTab *tabs,
Cardinal tab_count);

πŸ’– DESCRIPTION πŸ’–

so basically, XmTabListReplacePositions creates a brand new tab list that contains the contents of oldlist, except the tabs sitting at the positions in position_list get replaced with copies of the corresponding tabs in tabs. it's a glow-up, not a makeover from scratch β€” everything else stays exactly as it was πŸ’…

and listen, if a specified position is invalid, a warning message is displayed πŸ‘€ like, for example, if the value is a number greater than the number of tabs in the tab list. she will literally tell you. not me catching strays for your off-by-one 😭

heads up: this function deallocates the original tab list after extracting the required information. gone. bye. periodt. πŸ’€

also, it is the caller's responsibility to free the tabs in tabs by using the XmTabFree function. that's your job, bestie, not hers 🫢

  • oldlist β€” Specifies the tab list. The function deallocates the tab list after extracting the required information. (yes, for real, it's freeing it β€” don't touch it after βœ‹)
  • position_list β€” Specifies an array of positions of the tabs to be replaced. The position of the first tab is 0 (zero), the position of the second tab is 1, and so on. classic zero-indexing, no cap 🧚
  • tabs β€” Specifies an array of the replacement tabs. these are the new main characters πŸ‘‘
  • tab_count β€” Specifies the number of elements in position_list and tabs. one number for both arrays, she keeps them in sync, that's the vibe ⭐

πŸŽ€ RETURN πŸŽ€

okay so the returns are lowkey conditional and you need to know both paths:

  • If tabs, oldlist, or position_list is NULL, or tab_count is 0 (zero), it returns oldlist. (basically "nothing to do here, here's your list back" πŸ™ˆ)
  • Otherwise, this function returns the new tab list ✨

and important: the function allocates space to hold the returned tab list. The application is responsible for managing the allocated space. The application can recover the allocated space by calling XmTabListFree. so like, she allocated it, you free it. teamwork, babes 🀝



and that's the whole page, fr fr πŸ’œ this was XmTabListReplacePositions(library call) β€” that's the source/version tag and the little footer signature, both rolled into one, so consider this your cute sign-off 🫢 slay, go replace some tabs, and don't forget XmTabFree 😭🌸