Implemented uiMenu window identification in the test program. It works on all platforms.
This commit is contained in:
parent
d25c954d9f
commit
9e6678b635
|
@ -53,6 +53,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
w = newWindow("Main Window", 320, 240, 1);
|
||||
uiWindowOnClosing(w, onClosing, NULL);
|
||||
printf("main window %p\n", w);
|
||||
|
||||
mainBox = newHorizontalBox();
|
||||
uiWindowSetChild(w, uiControl(mainBox));
|
||||
|
|
|
@ -15,6 +15,7 @@ uiMenuItem *enabledItem;
|
|||
uiMenuItem *enableThisItem;
|
||||
uiMenuItem *forceCheckedItem;
|
||||
uiMenuItem *forceUncheckedItem;
|
||||
uiMenuItem *whatWindowItem;
|
||||
uiMenu *moreTestsMenu;
|
||||
uiMenuItem *quitEnabledItem;
|
||||
uiMenuItem *prefsEnabledItem;
|
||||
|
@ -42,6 +43,11 @@ static void forceOff(uiMenuItem *item, uiWindow *w, void *data)
|
|||
uiMenuItemSetChecked(enabledItem, 0);
|
||||
}
|
||||
|
||||
static void whatWindow(uiMenuItem *item, uiWindow *w, void *data)
|
||||
{
|
||||
printf("menu item clicked on window %p\n", w);
|
||||
}
|
||||
|
||||
void initMenus(void)
|
||||
{
|
||||
fileMenu = uiNewMenu("File");
|
||||
|
@ -66,6 +72,9 @@ void initMenus(void)
|
|||
uiMenuItemOnClicked(forceCheckedItem, forceOn, NULL);
|
||||
forceUncheckedItem = uiMenuAppendItem(testMenu, "Force Above Unchecked");
|
||||
uiMenuItemOnClicked(forceUncheckedItem, forceOff, NULL);
|
||||
uiMenuAppendSeparator(testMenu);
|
||||
whatWindowItem = uiMenuAppendItem(testMenu, "What Window?");
|
||||
uiMenuItemOnClicked(whatWindowItem, whatWindow, NULL);
|
||||
|
||||
moreTestsMenu = uiNewMenu("More Tests");
|
||||
quitEnabledItem = uiMenuAppendCheckItem(moreTestsMenu, "Quit Item Enabled");
|
||||
|
|
Loading…
Reference in New Issue