button->connect issues

Started by Alexhero, 30 January 2021, 17:28:17

Alexhero

I need to call a function(which is loading an another element of ui) when the button is pressed.I'm currently using tgui v.0.8.8. Help me pls

texus

Your parameters are in the wrong order. The showPause function is declared with the window as second parameter but you are passing it as first parameter in the connect call.

Alexhero

It still doesn't work and I am getting the same mistake

"error: no matching function for call to "tgui::Button::connect(const char [8], <unresolved overloaded function type>,...)"

texus

I can't reproduce such error.
Can you post some minimal code that I can copy-paste so that I'm testing the exact same code?

Alexhero

I have fixed those error, but now I have a new one, I've changed a code, so now I have a gui as parameter.

texus

Try "std::ref(gui)" instead of "gui", since your function takes a reference as parameter.

Alexhero

Thank you so much. You are the best