XtPopdown(3)

πŸŽ€ NAME πŸŽ€

XtPopdown, XtCallbackPopdown β€” unmap a pop-up, bestie πŸ’…


✨ SYNTAX ✨

#include <X11/Intrinsic.h>

void XtPopdown(Widget popup_shell);

void XtCallbackPopdown(Widget w, XtPointer client_data, XtPointer
       call_data);

πŸ”₯ ACTIONS πŸ”₯

void XtMenuPopdown(String shell_name);

🫢 ARGUMENTS 🫢

  • call_data β€” the callback data. It's giving decoration tbh, this procedure does not use it. πŸ’€
  • client_data β€” a pointer to the XtPopdownID structure. Yes queen, point at the struct.
  • popup_shell β€” the widget shell you want to pop down. Bye bestie πŸ‘‹
  • shell_name β€” the name of the widget shell you want to pop down.
  • w β€” the widget. Just… the widget.

πŸ’– DESCRIPTION πŸ’–

So XtPopdown does a whole little routine, and honestly? It eats. Here's the whole choreography, in order:

  • Calls XtCheckSubclass to make sure popup_shell is a subclass of Shell. Gotta verify the vibe first ✨
  • Checks that popup_shell is currently popped_up β€” and if it is not, it generates an error. No popping down what was never popped up, periodt.
  • Unmaps popup_shell's window.
  • If popup_shell's grab_kind is either XtGrabNonexclusive or XtGrabExclusive, it calls XtRemoveGrab.
  • Sets pop-up shell's popped_up field to False.
  • Calls the callback procedures on the shell's popdown_callback list.

πŸ¦‹ The struct moment πŸ¦‹

XtCallbackPopdown casts the client_data parameter to an XtPopdownID pointer, and it looks like this:

typedef struct {
        Widget shell_widget;
        Widget enable_widget;
} XtPopdownIDRec, *XtPopdownID;

So shell_widget is the pop-up shell to pop down, and enable_widget is the widget that was used to pop it up. Iconic duo fr fr πŸ‘‘

XtCallbackPopdown calls XtPopdown with the specified shell_widget and then calls XtSetSensitive to resensitize the enable_widget. Waking it back up like the main character it is 🌸


🧚 XtMenuPopdown lore 🧚

If a shell name is not given, XtMenuPopdown calls XtPopdown with the widget for which the translation is specified.

If a shell_name is specified in the translation table, XtMenuPopdown tries to find the shell by looking up 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 down the shell; otherwise, it moves up the parent chain as needed.

And if XtMenuPopdown gets all the way to the application top-level shell widget and still cannot find a matching shell β€” it generates an error. It looked everywhere bestie, there's nothing left to search 😭

πŸ‘€ SEE ALSO πŸ‘€


Okay that's the whole page, love u, go forth and unmap responsibly πŸ’œ This lil manual moment came to you from X Version 11, libXt 1.3.1, and the one and only XtPopdown(3) πŸŽ€βœ¨ no cap, that's the whole source-and-version situation, mwah 🫢

πŸ“¦ where this page comes from