Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call a variable amount of function #23

Closed
AnthonyPapageo opened this issue Mar 25, 2019 · 1 comment
Closed

Call a variable amount of function #23

AnthonyPapageo opened this issue Mar 25, 2019 · 1 comment
Labels
type: question Need help using the repository.

Comments

@AnthonyPapageo
Copy link

Hi !

First of all thanks for the great library, it's really useful and clear !

I have a problem with the LiquidLine::call_function method. How it works from what I understand from the source code is that it checks if the amount of function given as parameters is valid. If it is, it calls the function, else it does nothing.

My problems lies in the fact that some line have multiple function in my menu. For example some just have a gotoOtherMenu function but some have a goto to change the screen + an other function.

My buttonsCheck function look like this :

void buttonsCheck(Pushbutton& up, Pushbutton& down, Pushbutton& OK, LiquidMenu& menu)
{
	if(up.getSingleDebouncedPress())
	{
		menu.switch_focus(false); //Go up
	}
	else if(down.getSingleDebouncedPress())
	{
		menu.switch_focus(true); //Go down
	}
	else if(OK.getSingleDebouncedPress())
	{
		menu.call_function(1);//Won't work on line with 2 functions
		//menu.call_function(2);//Won't work on line with 1 functions
	}		
}

The only workaround that I have found is to have all Line object have the same amount of function attached with x amount of empty function attached.

Thanks in advance,

Anthony

@AnthonyPapageo AnthonyPapageo changed the title Call an unknown amount of function Call a variable amount of function Mar 25, 2019
@AnthonyPapageo
Copy link
Author

Nevermind I was not understing how it works properly, i'll just do this :

else if(OK.getSingleDebouncedPress())
	{
		for (i = 0; i<=MAX_FUNCTIONS;i++)
		{
			menu.call_function(i);
		}
	}

Sorry for creating an issue, have a great day

Anthony

@VasilKalchev VasilKalchev added the type: question Need help using the repository. label Dec 4, 2019
Repository owner locked and limited conversation to collaborators Nov 4, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
type: question Need help using the repository.
Projects
None yet
Development

No branches or pull requests

2 participants