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

πŸ’– XmStringDrawUnderline πŸ’–

okay bestie, so this one is XmStringDrawUnderline(library call) and it's literally the glow-up button for your compound strings, no cap ✨


✨ NAME ✨

XmStringDrawUnderline β€” a compound string function that underlines a string drawn in an X Window. it's giving "put a lil line under the important part" energy πŸ’…


🌸 SYNOPSIS 🌸

#include <Xm/Xm.h>
void XmStringDrawUnderline(
Display * d,
Window w,
XmRenderTable rendertable,
XmString string,
GC gc,
Position x,
Position y,
Dimension width,
unsigned char alignment,
unsigned char layout_direction,
XRectangle * clip,
XmString underline);

like yes, that's a lot of arguments, but she's worth it 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

XmStringDrawUnderline draws a compound string in an X Window. and here's the cute part: if the substring identified by underline can be matched inside string, that substring gets underlined. πŸŽ€ once a match has happened, no further matches or underlining will be done β€” one and done, she said periodt. also, only the first text component of underline is used for matching. just the first one. iykyk.

⚠️ okay real talk, this next bit matters so pay attention bestie. if a compound string segment uses a rendition that contains a font set, the graphic context you pass to this routine will have the GC font member left in an undefined state. the underlying XmbStringDraw function called by this routine modifies the font ID field of the GC passed into it and does not attempt to restore the font ID to the incoming value. 😭 no restoration, no apology.

if the compound string segment is not drawn using a font set, the graphic context must contain a valid font member. and graphic contexts created by XtGetGC are not accepted by this routine β€” instead, use XtAllocateGC to create a graphic context. do not come in here with an XtGetGC GC, she will not open the door πŸ™ˆ


the arguments, one by one, slay by slay πŸ’œ

  • d β€” Specifies the display.
  • w β€” Specifies the window.
  • rendertable β€” Specifies the render table.
  • string β€” Specifies the string.
  • gc β€” Specifies the graphics context to use.
  • x β€” Specifies a coordinate of the rectangle that will contain the displayed compound string.
  • y β€” Specifies a coordinate of the rectangle that will contain the displayed compound string.
  • width β€” Specifies the width of the rectangle that will contain the displayed compound string.
  • alignment β€” Specifies how the string will be aligned within the specified rectangle. It is one of XmALIGNMENT_BEGINNING, XmALIGNMENT_CENTER, or XmALIGNMENT_END. pick your fighter πŸ‘‘
  • layout_direction β€” Controls the direction in which the segments of the compound string will be laid out. It also determines the meaning of the alignment parameter. so yeah, these two are besties, they communicate 🌈
  • clip β€” Allows the application to restrict the area into which the compound string will be drawn. If it is NULL, clipping will be determined by the GC.
  • underline β€” Specifies the substring to be underlined. the main character of this whole function, fr fr ⭐


and that's the whole vibe, babe πŸ’– this page was XmStringDrawUnderline(library call) β€” straight from the library call section of the manual, no date stamp drama, just pure Motif realness. go underline something iconic and stay hydrated πŸ“βœ¨