XMPRINTSETUP(3)
π XmPrintSetup π
okay bestie, gather round, because this one is a library call from the Xm family and it's literally the glow-up your app needs to go from screen-only to printing queen. no cap. πΈ
β¨ NAME β¨
XmPrintSetup β setup and create a Print Shell widget π
β¨ SYNOPSIS β¨
#include <Xm/Print.h>
Widget XmPrintSetup(
Widget video_widget,
Screen *print_screen,
String print_shell_name,
ArgList args,
Cardinal num_args);
β¨ DESCRIPTION β¨
so basically, this function does the appropriate setting and creates a realized XmPrintShell that it hands right back to you. it's giving personal assistant energy. π
It hides all the fiddly Xt details of setting up a valid print shell hierarchy for your app, and honestly? It's also meant to encourage consistency in the way applications root their print widget hierarchy β like, everyone matching outfits. iconic. π
print_screen must belong to a Display connection that has already been initialized with Xt. no skipping steps bestie, that's non-negotiable. π«
The video_widget is used to get at the application context, application name and class, and argc/argv stored on the applicationShell that roots this widget. and if no applicationShell is found? no drama, NULL argv/argc are used. π«Ά
Then XmPrintSetup creates an unrealized ApplicationShell with the same name and class as the one given by the video display, on the print display and on the print screen specified. matchy-matchy. β¨
An XmPrintShell is then created as a child of this toplevel shell, using XtCreatePopupShell, with the name print_shell_name, and using the args provided. Then it realizes and maps the print shell, using XtPopup with XtGrabNone. boom, it's alive. π₯
This way, application resource files and users can specify print specific attributes using the following syntax (if print_shell_name is "Print"):
Dtpad.Print*textFontList: somefont
*Print*background:white
*Print*highlightThickness:0
π¦ the arguments, bestie π¦
video_widgetβ a video widget to fetch app video data from. your source of truth, lowkey. πΉprint_screenβ a print screen on the print display β it specifies the screen onto which the new shell is created. this is the where. π¨οΈprint_shell_nameβ specifies the name of theXmPrintShellcreated on the X Print server. name her! πargsβ specifies the argument list from which to get the resources for theXmPrintShell. all the little settings. πnum_argsβ specifies the number of arguments in the argument list. yes, you gotta count them. πΈ
β¨ RETURN VALUE β¨
The id of the XmPrintShell widget created on the X Print Server connection π
β or NULL if an error has occured. (their spelling, not mine, we don't gatekeep π)
β¨ ERRORS/WARNINGS β¨
None. π clean. pristine. no notes. β¨
β¨ EXAMPLES β¨
From the OK callback and the SetUp callback of the primary print dialog widget:
static void
printOKCB(Widget, XtPointer call_data, XtPointer client_data)
{
AppPrint *p = (AppPrint *) client_data;
DtPrintSetupCallbackStruct *pbs =
(XmPrintCallbackStruct *) call_data;
/* connect if not already done.
the print dialog callback always provides valid
printer name, print display and screen
already initialized: XpInitContext called */
*/
p->print_shell = XmPrintSetup (widget, pbs->print_screen,
"Print", NULL, 0);
...
}
β¨ SEE ALSO β¨
XmPrintShell(3), XmRedisplayWidget(3), XmPrintToFile(3), XmPrintPopupPDM(3)
go read those too bestie, they're all part of the same friend group π«Ά
and that's the whole page fr fr π this was XmPrintSetup from the library call manual, brought to you by the source/version and date sitting pretty down at the bottom of the original page β mwah, stan. πππ
π¦ where this page comes from
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms