Edit Box Help

Started by EditBox ReturnKeyPressed, 27 December 2016, 12:10:09

EditBox ReturnKeyPressed

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

Could you also show the declaration of dealWithTextEntered?

texus

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.