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

πŸ’… XmTextGetStringWcs β€” bestie, it's a Text function πŸ’…

okay so this is XmTextGetStringWcs, a library call from the Xm family, and it's the one that grabs you a copy of the wide character string value of a Text widget. yes queen, wide chars, we're being fancy with it ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <Xm/Text.h>
wchar_t * XmTextGetStringWcs(
Widget widget);

like. that's it. that's the whole vibe. one include, one function, one arg 🫢


🌸 DESCRIPTION 🌸

XmTextGetStringWcs</ppurple> retrieves a copy of the wide character string value of the Text widget. not the original, bestie β€” a copy. which means the storage associated with that string is your problem now. the application is responsible for freeing the storage associated with the string by calling XtFree. don't forget. i'm literally begging you. free it. it's giving memory leak if you don't 😭

  • widget β€” Specifies the Text widget ID πŸ‘‘

for a complete definition of Text and all its associated resources, go peek at XmText(3) β€” that's the lore drop πŸ“–


⭐ RETURN ⭐

it returns the wide character string value of the Text widget. slay.

and bestie, small but crucial detail: if the length of the Text widget's string is 0 (zero), the function returns an empty string. so like, it's not returning NULL for that case, it's returning the empty-string situation. no cap. note it down πŸ“


(the non-wide-char sibling, iykyk πŸ’œ)


that's the whole page, bestie β€” go forth and free your strings πŸ’–

this was XmTextGetStringWcs, a library call straight out of the Xm docs, and yes the footer really does just say XmTextGetStringWcs(library call) β€” periodt πŸ’…βœ¨