rezaali / ofxUI

[DEPRECATED] UI Addon for openFrameworks
http://www.syedrezaali.com/#/ofxui-project-showcase/
518 stars 202 forks source link

update ofUITextInput via code #246

Open Prodical opened 9 years ago

Prodical commented 9 years ago

Hi

In a previous version of ofxUI I could change the value of a Text Input box via code using the following: char mratioStr[16]; sprintf(mratioStr, "%i/%i", mcol, mrow); ((ofxUITextInput*) guiSC->getWidget("TEXT INPUT"))->setTextString(mratioStr);

Since updating to oF8.4 and the newest version of ofxUI I can't seem to get this code to work... or any other code e.g.

string mRatioFractionString = "TEST"; mRatioFractionWidget->setTextString(mRatioFractionString);

where I've declared this elsewhere in the code:

ofxUITextInput *mRatioFractionWidget; mRatioFractionWidget = new ofxUITextInput("TEXT INPUT", "1/1", 60, 25);

oF consistently breaks at line 393 of ofxUITextInput.cpp textstring = ""; with an error: Thread 1: EXC_BAD_ACCESS (code = 1, address = 0x8c)

I've been banging my head against this a while... any advice appreciated.

Best

Prodical