652 views
in Getting started by
Hello, is there a way to use the same variable in two different classes?

I have:

application::default and application::setup and I'd like to use in application::setup a variable that I had modified in application::defaut. The variable is a string, so I can't use the Enum or Set.

1 Answer

0 votes
by

Hello,

if you want to have variables (e.g. to store some settings) that should be accessible from different components within your applications, you can put these variables into a separate class and create an autoobject of this class (e.g. Application::Settings). 

Best regards,

Manfred. 

by
Thanks, it's worked. But If I need to change the variable decleared in Application:Settings in another class (e.g. Application::default) and make the change visible to others classes, what shuold I do?
by

You can use notifications and observers to inform your GUI components about changes within the settings class. Is this what you are looking for?

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...