XtPopup(3)
β¨ NAME β¨
okay so bestie, meet the pop-up map squad π β XtPopup, XtPopupSpringLoaded, XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive. their whole thing? mapping a pop-up. that's it, that's the job. this is from the XT FUNCTIONS corner of the XtPopup(3) manual and it's lowkey iconic π
πΈ SYNTAX πΈ
no cap, here's exactly how you call these:
#include <X11/Intrinsic.h>
void XtPopup(Widget popup_shell, XtGrabKind grab_kind);
void XtPopupSpringLoaded(Widget popup_shell);
void XtCallbackNone(Widget w, XtPointer client_data, XtPointer
call_data);
void XtCallbackNonexclusive(Widget w, XtPointer client_data, XtPointer
call_data);
void XtCallbackExclusive(Widget w, XtPointer client_data, XtPointer
call_data);
π ACTIONS π
one (1) action lives here, and it's giving translation-manager energy:
void XtMenuPopup(String shell_name);
π ARGUMENTS π
okay bestie here's what each lil parameter actually is, periodt:
call_dataβ specifies the callback data, which is not used by this procedure. so like, it's there, it's just not the moment πclient_dataβ specifies the pop-up shell.grab_kindβ specifies the way in which user events should be constrained. the vibe control β¨popup_shellβ specifies the widget shell.wβ specifies the widget.
π DESCRIPTION π
π¦ XtPopup, step by step
the XtPopup function performs the following, in order, no skipping:
- Calls
XtCheckSubclassto ensurepopup_shellis a subclass ofShell. gotta check the vibes first π«Ά - Generates an error if the shell's
popped_upfield is alreadyTrue. (not me trying to pop up something that's already up π) - Calls the callback procedures on the shell's
popup_callbacklist. - Sets the shell
popped_upfield toTrue, the shellspring_loadedfield toFalse, and the shellgrab_kindfield fromgrab_kind. - If the shell's
create_popup_childfield is non-NULL,XtPopupcalls it withpopup_shellas the parameter. - If
grab_kindis eitherXtGrabNonexclusiveorXtGrabExclusive, it calls:
XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), False)
- Calls
XtRealizeWidgetwithpopup_shellspecified. - Calls
XMapWindowwithpopup_shellspecified.
slay, that's the whole sequence β¨
π§ XtPopupSpringLoaded
the XtPopupSpringLoaded function performs exactly as XtPopup except that it sets the shell spring_loaded field to True and always calls XtAddGrab with exclusive True and spring_loaded True. so like, same energy, springier π
π XtCallbackNone, XtCallbackNonexclusive, XtCallbackExclusive
the XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive functions call XtPopup with the shell specified by the client_data argument and grab_kind set as the name specifies. XtCallbackNone, XtCallbackNonexclusive, and XtCallbackExclusive specify XtGrabNone, XtGrabNonexclusive, and XtGrabExclusive, respectively. each function then sets the widget that executed the callback list to be insensitive by using XtSetSensitive.
okay important caveat bestie: using these functions in callbacks is not required. in particular, an application must provide customized code for callbacks that create pop-up shells dynamically or that must do more than desensitizing the button. so don't come for me if you need more π
π₯ XtMenuPopup
XtMenuPopup is known to the translation manager, which must perform special actions for spring-loaded pop-ups. calls to XtMenuPopup in a translation specification are mapped into calls to a nonexported action procedure, and the translation manager fills in parameters based on the event specified on the left-hand side of a translation.
if XtMenuPopup is invoked on ButtonPress (possibly with modifiers), the translation manager pops up the shell with grab_kind set to XtGrabExclusive and spring_loaded set to True. if XtMenuPopup is invoked on EnterWindow (possibly with modifiers), the translation manager pops up the shell with grab_kind set to XtGrabNonexclusive and spring_loaded set to False. otherwise, the translation manager generates an error π
when the widget is popped up, the following actions occur:
- Calls
XtCheckSubclassto ensurepopup_shellis a subclass ofShell. - Generates an error if the shell's
popped_upfield is alreadyTrue. - Calls the callback procedures on the shell's
popup_callbacklist. - Sets the shell
popped_upfield toTrueand the shellgrab_kindandspring_loadedfields appropriately. - If the shell's
create_popup_childfield is non-NULL, it is called withpopup_shellas the parameter. - Calls:
XtAddGrab(popup_shell, (grab_kind == XtGrabExclusive), spring_loaded)
- Calls
XtRealizeWidgetwithpopup_shellspecified. - Calls
XMapWindowwithpopup_shellspecified.
(Note that these actions are the same as those for XtPopup.) π
XtMenuPopup tries to find the shell by searching the widget tree starting at the parent of the widget in which it is invoked. if it finds a shell with the specified name in the pop-up children of that parent, it pops up the shell with the appropriate parameters. otherwise, it moves up the parent chain as needed. if XtMenuPopup gets to the application widget and cannot find a matching shell, it generates an error. not the ending we wanted but okay π
π SEE ALSO π
go read these next, bestie, iykyk:
XtCreatePopupShell(3),XtPopdown(3)- X Toolkit Intrinsics - C Language Interface
- Xlib - C Language X Interface
and that's the whole page, fr fr πΈ this was X Version 11, libXt 1.3.1, from the XtPopup(3) manual β mwah, take care of your pop-up shells bestie ππ¦β¨
π¦ 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