XtConfigureWidget(3)
π NAME π
okay so bestie, listen up β XtConfigureWidget, XtMoveWidget, XtResizeWidget are literally the trio that moves and resizes widgets. that's it, that's the whole vibe. β¨
This is from the XT FUNCTIONS part of the X Toolkit Intrinsics, which is a very real manual page that lives in section 3 (library calls, for the uninitiated π«Ά).
πΈ SYNTAX πΈ
first things first, you gotta pull in the header, no cap:
#include <X11/Intrinsic.h>
and here are the four function signatures, exactly as they are, don't come for me:
void XtConfigureWidget(Widget w, Position x, Position y, Dimension
width, Dimension height, Dimension border_width);
void XtMoveWidget(Widget w, Position x, Position y);
void XtResizeWidget(Widget w, Dimension width, Dimension height,
Dimension border_width);
void XtResizeWindow(Widget w);
π ARGUMENTS π
here's the tea on what you're actually passing in:
width,height,border_widthβ these three are giving "new widget size". specify the new widget size, that's the whole job. πwβ specifies the widget. yes, just... the widget. the one you're doing stuff to. the main character. πx,yβ specify the new widgetxandycoordinates. where it's gonna be. its little home on screen. π¦
β¨ DESCRIPTION β¨
okay so this is the part where we get into it, and honestly it's giving "four functions, four different amounts of chaos". let's go one at a time.
π XtConfigureWidget
XtConfigureWidget returns immediately if the specified geometry fields are the same as the old values β like, it's not gonna do work it doesn't need to do, periodt.
Otherwise? It writes the new x, y, width, height, and border_width values into the widget. and β if the widget is realized (iykyk, realized = it has an actual X window) β it makes an Xlib XConfigureWindow call on the widget's window. π₯
and here's the detail that lowkey matters: if either the new width or height is different from its old value, XtConfigureWidget calls the widget's resize procedure to notify it of the size change. otherwise, it simply returns. that's it, no drama, no resize procedure. π
π XtMoveWidget
XtMoveWidget also returns immediately if the specified geometry fields match the old ones. same energy.
Otherwise, XtMoveWidget writes the new x and y values into the widget, and β if the widget is realized β it issues an Xlib XMoveWindow call on the widget's window. just moving, no resizing, we're keeping the size exactly as it is bestie. πΆβοΈβ¨
π XtResizeWidget
yep, you guessed it: XtResizeWidget returns immediately if the specified geometry fields are the same as the old values. iconic consistency. π
Otherwise, XtResizeWidget writes the new width, height, and border_width values into the widget, and if the widget is realized, issues an XConfigureWindow call on the widget's window.
and then β if the new width or height are different from the old values, XtResizeWidget calls the widget's resize procedure to notify it of the size change. size changed = resize procedure gets the memo. π¬
π XtResizeWindow
now THIS one is the wildcard of the group. XtResizeWindow calls the XConfigureWindow Xlib function to make the window of the specified widget match its width, height, and border width.
π¨ and here's the important bit: this request is done unconditionally, because there is no way to tell if these values match the current values. so it just... sends it. every time. no vibe check available. π
also note: the widget's resize procedure is NOT called. not even a little bit. π
and then the manual page says the quiet part out loud: there are very few times to use XtResizeWindow; instead, you should use XtResizeWidget. like, genuinely, bestie, just use XtResizeWidget. that's the recommendation, straight from the source. π«Ά
π SEE ALSO π
go read these next, they're all part of the same lore:
XtMakeGeometryRequest(3)XtQueryGeometry(3)X Toolkit Intrinsics - C Language InterfaceXlib - C Language X Interface
and that's the whole page, no notes. this one's from X Version 11, specifically libXt 1.3.1 β so if you see it in the wild under XtConfigureWidget(3), you know it's the real one. slay, go configure some widgets, you got this πβ¨ππ¦
π¦ where this page comes from
- alpine 3.22: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.23: libxt-doc 1.3.1-r0 Β· MIT
- alpine 3.24: libxt-doc 1.3.1-r0 Β· MIT
- arch rolling: libxt 1.3.1-1 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 43: libXt-devel 1.3.1-3.fc43 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- fedora 44: libXt-devel 1.3.1-4.fc44 Β· MIT AND HPND-sell-variant AND SMLNJ AND MIT-open-group AND X11
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXt-devel 1.3.1-160000.3.2 Β· MIT
- Copyright 1993 X Consortium
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms