Added tests for uiMenuItemSetChecked(). It all works!
This commit is contained in:
parent
11ad023f78
commit
92e0ac02b4
|
@ -27,6 +27,16 @@ static void enableItemTest(uiMenuItem *item, uiWindow *w, void *data)
|
||||||
uiMenuItemDisable(enableThisItem);
|
uiMenuItemDisable(enableThisItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void forceOn(uiMenuItem *item, uiWindow *w, void *data)
|
||||||
|
{
|
||||||
|
uiMenuItemSetChecked(enabledItem, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void forceOff(uiMenuItem *item, uiWindow *w, void *data)
|
||||||
|
{
|
||||||
|
uiMenuItemSetChecked(enabledItem, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void initMenus(void)
|
void initMenus(void)
|
||||||
{
|
{
|
||||||
fileMenu = uiNewMenu("File");
|
fileMenu = uiNewMenu("File");
|
||||||
|
@ -47,7 +57,9 @@ void initMenus(void)
|
||||||
uiMenuItemOnClicked(enabledItem, enableItemTest, NULL);
|
uiMenuItemOnClicked(enabledItem, enableItemTest, NULL);
|
||||||
enableThisItem = uiMenuAppendItem(testMenu, "This Will Be Enabled");
|
enableThisItem = uiMenuAppendItem(testMenu, "This Will Be Enabled");
|
||||||
forceCheckedItem = uiMenuAppendItem(testMenu, "Force Above Checked");
|
forceCheckedItem = uiMenuAppendItem(testMenu, "Force Above Checked");
|
||||||
|
uiMenuItemOnClicked(forceCheckedItem, forceOn, NULL);
|
||||||
forceUncheckedItem = uiMenuAppendItem(testMenu, "Force Above Unchecked");
|
forceUncheckedItem = uiMenuAppendItem(testMenu, "Force Above Unchecked");
|
||||||
|
uiMenuItemOnClicked(forceUncheckedItem, forceOff, NULL);
|
||||||
|
|
||||||
helpMenu = uiNewMenu("Help");
|
helpMenu = uiNewMenu("Help");
|
||||||
helpItem = uiMenuAppendItem(helpMenu, "Help");
|
helpItem = uiMenuAppendItem(helpMenu, "Help");
|
||||||
|
|
Loading…
Reference in New Issue