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

πŸ’– XmCreateScrolledText πŸ’–

okay bestie, gather round, because this is one of those <Xm/Text.h> library call girlies and she is so useful once you get her. this is the XmCreateScrolledText era and we're thriving.


✨ NAME ✨

XmCreateScrolledText β€” the Text ScrolledText convenience creation function. yes she's a convenience function, she's doing the most so you don't have to 🫢


✨ SYNOPSIS ✨

#include <Xm/Text.h>
Widget XmCreateScrolledText(
Widget parent,
String name,
ArgList arglist,
Cardinal argcount);

✨ DESCRIPTION ✨

so like, XmCreateScrolledText creates an instance of a Text widget that is contained within a ScrolledWindow. the ScrolledWindow parent? created managed, periodt. all the ScrolledWindow subarea widgets are automatically created by this function too, no cap, she handles it. πŸ’…

now here's the plot twist you need to hear: the ID returned by this function is that of the Text widget, NOT the ScrolledWindow widget. not me almost confusing them 😭 use this widget ID for all operations on the Text widget. and use the widget ID of the Text widget's parent for all operations on the ScrolledWindow. to obtain the ID of the ScrolledWindow widget associated with the Text widget, use the Xt Intrinsics XtParent function. iykyk. the name of the ScrolledWindow created by this function is formed by concatenating the letters SW onto the end of the name specified in the parameter list. iconic naming convention honestly.

the Text widget defaults to single-line text edit; therefore, no ScrollBars are displayed. so if you're sitting there like "where are my scrollbars bestie" β€” that's why. the Text resource XmNeditMode must be set to XmMULTI_LINE_EDIT to display the ScrollBars. 🌈

⚠️ and listen, the results of placing a Text widget inside a ScrolledWindow when the Text's XmNeditMode is XmSINGLE_LINE_EDIT are undefined. undefined behaviour is not the vibe, do not do this. πŸ’€

all arguments to either the Text or the ScrolledWindow widget can be specified at creation time with this function. changes to initial position and size are sent only to the ScrolledWindow widget. other resources are sent to the Text or the ScrolledWindow widget as appropriate. note that the result of providing the XmNdestroyCallback resource in the creation arglist is unspecified. 🚨 the application should use the XtAddCallback function to add callbacks to the appropriate widget (Text or ScrolledWindow) after creating it. do it after, bestie, that's the move.

this function forces the following initial values for ScrolledWindow resources:

  • XmNscrollingPolicy is set to XmAPPLICATION_DEFINED.
  • XmNvisualPolicy is set to XmVARIABLE.
  • XmNscrollBarDisplayPolicy is set to XmSTATIC.
  • XmNshadowThickness is set to 0 (zero).

🌸 the arguments 🌸

  • parent β€” specifies the parent widget ID. the parent, the origin story, the one who birthed you πŸ’œ
  • name β€” specifies the name of the created widget. and remember, SW gets glued onto the end of this for the ScrolledWindow.
  • arglist β€” specifies the argument list.
  • argcount β€” specifies the number of attribute/value pairs in the argument list (arglist).

for a complete definition of Text and its associated resources, see XmText(3). πŸŽ€


✨ RETURN ✨

returns the Text widget ID. that's it, that's the whole return value, she's simple like that ✨


XmScrolledWindow(3) and XmText(3). go read them, they're the supporting cast and they ate πŸ’–


and that's the whole page babes! this was XmCreateScrolledText, a library call, and she's out here in the wild doing her thing. mwah, drink water, go create some scrolled text, slay πŸ‘‘πŸ¦‹πŸŒΈ