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);
|
w = newWindow("Main Window", 320, 240, 1);
|
||||||
uiWindowOnClosing(w, onClosing, NULL);
|
uiWindowOnClosing(w, onClosing, NULL);
|
||||||
|
printf("main window %p\n", w);
|
||||||
|
|
||||||
mainBox = newHorizontalBox();
|
mainBox = newHorizontalBox();
|
||||||
uiWindowSetChild(w, uiControl(mainBox));
|
uiWindowSetChild(w, uiControl(mainBox));
|
||||||
|
|
|
@ -15,6 +15,7 @@ uiMenuItem *enabledItem;
|
||||||
uiMenuItem *enableThisItem;
|
uiMenuItem *enableThisItem;
|
||||||
uiMenuItem *forceCheckedItem;
|
uiMenuItem *forceCheckedItem;
|
||||||
uiMenuItem *forceUncheckedItem;
|
uiMenuItem *forceUncheckedItem;
|
||||||
|
uiMenuItem *whatWindowItem;
|
||||||
uiMenu *moreTestsMenu;
|
uiMenu *moreTestsMenu;
|
||||||
uiMenuItem *quitEnabledItem;
|
uiMenuItem *quitEnabledItem;
|
||||||
uiMenuItem *prefsEnabledItem;
|
uiMenuItem *prefsEnabledItem;
|
||||||
|
@ -42,6 +43,11 @@ static void forceOff(uiMenuItem *item, uiWindow *w, void *data)
|
||||||
uiMenuItemSetChecked(enabledItem, 0);
|
uiMenuItemSetChecked(enabledItem, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void whatWindow(uiMenuItem *item, uiWindow *w, void *data)
|
||||||
|
{
|
||||||
|
printf("menu item clicked on window %p\n", w);
|
||||||
|
}
|
||||||
|
|
||||||
void initMenus(void)
|
void initMenus(void)
|
||||||
{
|
{
|
||||||
fileMenu = uiNewMenu("File");
|
fileMenu = uiNewMenu("File");
|
||||||
|
@ -66,6 +72,9 @@ void initMenus(void)
|
||||||
uiMenuItemOnClicked(forceCheckedItem, forceOn, NULL);
|
uiMenuItemOnClicked(forceCheckedItem, forceOn, NULL);
|
||||||
forceUncheckedItem = uiMenuAppendItem(testMenu, "Force Above Unchecked");
|
forceUncheckedItem = uiMenuAppendItem(testMenu, "Force Above Unchecked");
|
||||||
uiMenuItemOnClicked(forceUncheckedItem, forceOff, NULL);
|
uiMenuItemOnClicked(forceUncheckedItem, forceOff, NULL);
|
||||||
|
uiMenuAppendSeparator(testMenu);
|
||||||
|
whatWindowItem = uiMenuAppendItem(testMenu, "What Window?");
|
||||||
|
uiMenuItemOnClicked(whatWindowItem, whatWindow, NULL);
|
||||||
|
|
||||||
moreTestsMenu = uiNewMenu("More Tests");
|
moreTestsMenu = uiNewMenu("More Tests");
|
||||||
quitEnabledItem = uiMenuAppendCheckItem(moreTestsMenu, "Quit Item Enabled");
|
quitEnabledItem = uiMenuAppendCheckItem(moreTestsMenu, "Quit Item Enabled");
|
||||||
|
|
Loading…
Reference in New Issue