MCPcopy Create free account
hub / github.com/SimHacker/micropolis / MenuEventProc

Function MenuEventProc

micropolis-activity/src/tk/tkmenu.c:1816–1844  ·  view source on GitHub ↗
(clientData, eventPtr)

Source from the content-addressed store, hash-verified

1814 * events on menus.
1815 *
1816 * Results:
1817 * None.
1818 *
1819 * Side effects:
1820 * When the window gets deleted, internal structures get
1821 * cleaned up. When it gets exposed, it is redisplayed.
1822 *
1823 *--------------------------------------------------------------
1824 */
1825
1826static void
1827MenuEventProc(clientData, eventPtr)
1828 ClientData clientData; /* Information about window. */
1829 XEvent *eventPtr; /* Information about event. */
1830{
1831 Menu *menuPtr = (Menu *) clientData;
1832 if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) {
1833 EventuallyRedrawMenu(menuPtr, -1);
1834 } else if (eventPtr->type == DestroyNotify) {
1835 Tcl_DeleteCommand(menuPtr->interp, Tk_PathName(menuPtr->tkwin));
1836
1837 /*
1838 * Careful! Must delete the event-sharing information here
1839 * rather than in DestroyMenu. By the time that procedure
1840 * is called the tkwin may have been reused, resulting in some
1841 * other window accidentally being cut off from shared events.
1842 */
1843
1844 Tk_UnshareEvents(menuPtr->tkwin, menuPtr->group);
1845 menuPtr->tkwin = NULL;
1846 if (menuPtr->flags & REDRAW_PENDING) {
1847 Tk_CancelIdleCall(DisplayMenu, (ClientData) menuPtr);

Callers

nothing calls this directly

Calls 5

EventuallyRedrawMenuFunction · 0.85
Tk_UnshareEventsFunction · 0.85
Tk_EventuallyFreeFunction · 0.85
Tk_CancelIdleCallFunction · 0.70
Tcl_DeleteCommandFunction · 0.50

Tested by

no test coverage detected