cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get callback in my view from custom container which is in another container?

heyo
Senior

Hello,

Is it possible to get callback on my view from custom container which is in another container? And how to do that?

I've tried to do like this. Create a callback for button:

0693W00000aHNeuQAG.pngHere goes when callback gets call. And I create an object of other class to call function:

0693W00000aHNpAQAW.pngAnd goes to this function:

0693W00000aHNptQAG.pngThe problem with this method is that does not perform commands like "setXY" and etc. but only touchgfx_printf works. What I do wrong?

7 REPLIES 7
MM..1
Chief III

show code where you add create object Addnewzonebutton

Addnewzonebutton is in InputOutputConfigurationViewBase it is automatically created by touchgfx

I don't understand why does not perform this function (marked in red)

0693W00000aI6m1QAC.pngOnly prints text and when go through functions and do nothing. I just call function from another class and give them indexes

JTP1
Lead

Maybe objects needs to invalidate() ?

No, there is handleTickEvent function and there calls invalidate every tick.

heyo
Senior

Hello again,

I'm stuck with it. Maybe someone can help?

I've tried two methods. Pass index by pointer and by class.

For better understanding what I want to do I try to explain. First of all in my view window is container and in that container I create a list using another container. On the left is my lists.

0693W00000aJIksQAG.pngThis is what I put in list and in this container I put another list:

0693W00000aJIlbQAG.png0693W00000aJIllQAG.pngSo here is "SelectController" button and for that I create callback and by click I get index of that button:

0693W00000aJImAQAW.pngSo I pass that index by pointer in HeatersAndCoolersConfiguration class

0693W00000aJImKQAW.pngAnd this is my function in my view window:

0693W00000aJImUQAW.pngProblem is that simulator crashes when I click SelectController button.0693W00000aJIn3QAG.pngAnother method that I tried to do pass index by function to call function in another class and it passes index but function like setY(), setVisible() does not work