2020-02-06 02:18 AM
hello people..
actually i want to display a string..
i did in this way
char buff[10]="hello";
Unicode::snprintf(buffer,10,"%s",buff);
but am not getting anything.....
in the prinf the buffer is i had the textarea from touchgfx that buffer am taking here...
can you sortout my issue
thank you...
2020-02-06 06:58 AM
No problem, glad you got it working!
2020-02-06 11:13 PM
hello....
actually am trying to pass a string which is defined in model.cpp
up to presenter i can able to pass the whole string but when am passing to the view only i can able to get only first character...why this issue
void Model::tick()
{
tickCounter++;
char buff[20] = "hello hai";
if (modelListener != NULL)
modelListener->notifythetext(buff);
}
modellistener.hpp:
virtual void notifythetext(char*) {}
presenter.cpp:
void Screen1Presenter::notifythetext(char *buff) {
view.newnotify(*buff);
}
presenter.hpp
virtual void notifythetext(char*);
view.cpp:
void Screen1View::newnotify(char buff)
{
touchgfx::Unicode::UnicodeChar dst[20];
Unicode::snprintf(textArea1Buffer, 20, "%s", textArea1Buffer, dst);
textArea1.invalidate();
textArea1.setWildcard(textArea1Buffer);
textArea1.resizeToCurrentText();
textArea1.invalidate();
}
view.hpp:
virtual void newnotify(char);
can you fix my issue
thank you
2020-02-06 11:18 PM
hello ..
I am trying to pass a string from model to view and am printing that into view ....whenever i change the string in model it sholud effect to view also....am can't able to do it while am passing, presenter taking whole string,but view receiving only 1st character..please fix my issue
thank you
2020-02-07 12:03 AM
helo..how to pass a string from model to view
thank you
2020-02-07 08:19 AM
Inside of the function void Screen1View::newnotify(char buff) you never copy buff into dst using the Unicode::strncpy() function.
2020-11-16 03:51 AM
thanks!!!, your reply was very helpful !
I got stuck at this part of program but after reading the code you posted I could fix the issue.
2024-10-26 07:49 PM
Hi,
Works fro me to Thanks.
Kind Regards
Rob