*

EditBox ReturnKeyPressed

Edit Box Help
« on: 27 December 2016, 12:10:09 »
I have a simple program, with a edit box, the code for the edit box is below
   tgui::EditBox::Ptr textbox = std::make_shared<tgui::EditBox>();
   gui.add(textbox, "TextBox");
   textbox->setPosition(50, 50);
   textbox->setSize(200, 50);
   textbox->connect("ReturnKeyPressed", dealWithTextEntered);

And I've been looking at all the available edit box signal information - such as the wiki and the examples, as well as the holy google - , and from what I've seen this should work fine, but it generates this error:
error C2338: Parameters passed to the connect function are wrong!

I bet I'm doing something really stupid.
Feel free to yell at me, or to ask for more information.

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Edit Box Help
« Reply #1 on: 27 December 2016, 12:31:54 »
Could you also show the declaration of dealWithTextEntered?

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: Edit Box Help
« Reply #2 on: 28 December 2016, 02:04:06 »
dealWithTextEntered either has to be a function without parameters or have an sf::String (or std::string) as parameter. The return type of the function has to be "void". The function can only have different parameters if they are bound by passing them to the connect function, as explained in the tutorial.