Skip to main content
Ameya M
Associate III
February 18, 2019
Solved

Sending values to Custom Container Widgets

  • February 18, 2019
  • 6 replies
  • 1398 views

Hello,

I am using a custom container which is used in most of the screens as TopBar showing various details.

The details are varied by using depending on the backend values of the system.

Normally, we use Model-Presenter-View for communicating with backend.

But how to control the widgets of custom container as there are no presenter/view for it.

Thanks,

Ameya

This topic has been closed for replies.
Best answer by Martin KJELDSEN

Hi @Ameya M​,

Containers are drawables that are added to your screen through the add() method. If you're using custom containers and you've added one to your canvas for a screen this has already been done for you by the designer.

The designer also creates an inherited class for you (e.g. public MyCustomContainer : public CustomContainerBase) which you can find in the gui/ folder. You can enhance this class with the methods you need so that you can setup the custom container from your view in whatever way you want: setupScreen() to initialize it, etc.

Hope that clarifies things a bit.

Best regards,

Martin

6 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
February 18, 2019

Hi @Ameya M​,

Containers are drawables that are added to your screen through the add() method. If you're using custom containers and you've added one to your canvas for a screen this has already been done for you by the designer.

The designer also creates an inherited class for you (e.g. public MyCustomContainer : public CustomContainerBase) which you can find in the gui/ folder. You can enhance this class with the methods you need so that you can setup the custom container from your view in whatever way you want: setupScreen() to initialize it, etc.

Hope that clarifies things a bit.

Best regards,

Martin

Ameya M
Ameya MAuthor
Associate III
February 18, 2019

Hi Martin,

Thanks for replying.

I tried to do as per your example codes posted on other posts.

But the event I have is nothing, like button press in the other example.

Currently, the values of the container (I am using Wildcard text buffer), get updated only when I change the screen,

How can the values be updated when on the same screen.

Thanks,

Ameya

Martin KJELDSEN
Principal III
February 18, 2019

Hi @Ameya M​,

Can you try telling me a bit more about what you're trying to do? It's not 100% clear to me if my first post did not help (It's a different approach from the example in the other posts). It seems like you're just interested in updating your custom containers with new values received from e.g. the model/other tasks.

And maybe also share your project with me. Thanks!

Best regards,

Martin