Skip to content

Example for using LiquidMenu inside classes #87

Answered by VasilKalchev
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, @Mark-81.

The problem is that the library holds pointers to functions and not pointers to member functions of your specific class. That's why you must trick the compiler by casting your member function address to a normal function address. You can read more about member function pointers here.

On your point about using classes for everything. If you're coming from Java or C#, it's not bad practice to have declarations outside of classes in C++. If you're new to coding, don't take guidelines as rules (and I'm pretty sure there isn't such a guideline). If you ask me, one of the best advices is to not write needlessly complex code.

...I have dozens of vars to set. I really don't want…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VasilKalchev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: question Need help using the repository.
1 participant