I need an array of structs that is going to be used to draw the elements of the screen based on what is the selected point (which is just a number).
Mainly I'm interested in the correct syntax of declaring a struct that has function pointers as members, creating an array that has elements of that struct type and passing arguments to those functions. Something like the code below but with correct syntax.
struct menuStruct
{
void *leftEdgeSymbol(boolean show);
void *certerScreenSymbol(boolean show);
void *rightEdgeSymbol(boolean show);
void *buttonFunction(void);
};
menuStruct allMenues[] =
{
{drawLeftArrow(), drawTempSettingText(), drawRightArrow(), mainMenu1()}, //0
{eraseLeftArrow(), drawHumidTargetText(), drawRightArrow(), mainMenu2()}, //1
{drawLeftMinusSign(), drawSetTempTarget(), drawRightPlusSign(), subMenu101() //2
}
void drawLeftArrow(boolean show)
{
//Draw the arrow with white colour to show or with black to erase
}
void rightArrow(boolean show)
{
//Draw the arrow with white colour to show or with black to erase
}