Hello,
after to have created by gui, I want to be sure 2 label toggles are off.
so I tried this:
ofxUILabelToggle *helpMenu = (ofxUILabelToggle*)gui->getWidget("HELP");
helpMenu->setValue(false);
ofxUILabelToggle *menu = (ofxUILabelToggle*)gui->getWidget("MENU");
menu->setValue(false);
EXEC_BAD_ACCESS
any other way ?
taprik
March 10, 2012, 9:51am
#2
Curious, it works for me.
Could you post a complete code example ?
The line below also work
((ofxUITextInput *)gui->getWidget("TEXT INPUT"))->setAutoClear(false);
if you want to set autoClear to false for a text input.
((ofxUILabelToggle*)gui->getWidget(“HELP”))->setValue(false);
((ofxUILabelToggle*)gui->getWidget(“MENU”))->setValue(false);
gives an error.
taprik
March 11, 2012, 9:37am
#4
It’s always difficult to help with little part of code.
Anyway, please find attached an xcode project where I put your two lines, and it works.
example-ofxUIButtons.zip
I can’t paste the whole stuff… tooooo huge.
BUT, I found something that works fine in my case: when I create the button, I can pass the initial state which is enough in my case.
I used this kind of line to set the initial state of many of my widgets with succes.
Thanks