Skip to main content
mSH.1
Associate III
Jul 20, 2022 9:36 AM UTC
Question

I want to receive the callback function from the button of "Container" by generating an event from "Screens".

hello​

​

I want to receive the callback function from the button of "Container" by generating an event from "Screens".

​

​

The following is the definition of Callback Function for Button in Container.

// @ Container
 
void CC_Pop_Cancel_Check::flexButton_confirm_event()
{
 // Override and implement this function in CC_Pop_Cancel_Check
}
 
void CC_Pop_Cancel_Check::flexButton_cancel_event()
{
 // Override and implement this function in CC_Pop_Cancel_Check
}

​

​

Below are Screens inserted into Container.

#include <gui/scrautoremain_i1_screen/ScrAutoReMain_i1View.hpp>
#include <texts/TextKeysAndLanguages.hpp>
#include "BitmapDatabase.hpp"
 
ScrAutoReMain_i1View::ScrAutoReMain_i1View() 
{
 
}
 
void ScrAutoReMain_i1View::setupScreen()
{
 ScrAutoReMain_i1ViewBase::setupScreen();
}
 
void ScrAutoReMain_i1View::tearDownScreen()
{
 ScrAutoReMain_i1ViewBase::tearDownScreen();
}

​

I want to receive the callback function generated from the button of the container from the scene in the event method.

​

​thank.

This topic has been closed for replies.

6 replies

Andrew Neil
Super User
Jul 20, 2022 9:52 AM UTC

Maybe just lost in translation, but you don't "receive" a callback function: you provide the function, and it gets called by the system on the specified event.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mSH.1
mSH.1Author
Associate III
Jul 20, 2022 10:49 AM UTC

hello, Andrew Neil (Community Member)

​

It was implemented by reading the button state of the container periodically with handleTickEvent() of screens.

​

Is this best?

​

tank.​

​

Andrew Neil
Super User
Jul 20, 2022 11:30 AM UTC

Sorry - what was implemented?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.