(clientData, eventPtr)
| 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 | |
| 1826 | static void |
| 1827 | MenuEventProc(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); |
nothing calls this directly
no test coverage detected