button->connect issues

  • 6 Replies
  • 115 Views
button->connect issues
« on: 30 January 2021, 17:28:17 »
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

  • *****
  • 1603
    • View Profile
    • Texus's Blog
Re: button->connect issues
« Reply #1 on: 30 January 2021, 17:30:28 »
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.

Re: button->connect issues
« Reply #2 on: 30 January 2021, 17:42:04 »
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

  • *****
  • 1603
    • View Profile
    • Texus's Blog
Re: button->connect issues
« Reply #3 on: 30 January 2021, 19:51:47 »
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?

Re: button->connect issues
« Reply #4 on: 31 January 2021, 13:49:10 »
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

  • *****
  • 1603
    • View Profile
    • Texus's Blog
Re: button->connect issues
« Reply #5 on: 31 January 2021, 14:00:28 »
Try "std::ref(gui)" instead of "gui", since your function takes a reference as parameter.

Re: button->connect issues
« Reply #6 on: 31 January 2021, 14:05:17 »
Thank you so much. You are the best