Hi there,
first post. I am just starting with Wt.

I was trying the Images layout found at
http://www.webtoolkit.eu/widgets/layout/imagesWt's example gallery.

When trying to compile the second example the following signal/slot
connection

image->mouseMoved().connect(std::bind([=] (const Wt::WMouseEvent& e) {
    out->setText("You're pointing the background at "
         "(" + boost::lexical_cast<std::string>(e.widget().x) +
         "," + boost::lexical_cast<std::string>(e.widget().y) +
         ").");
}, std::placeholders::_1));

results in series of compiler errors starting with
error C2903: 'result' : symbol is neither a class template nor a function
template

which, as far as I've been able to know, are related to the C++
implementation (C++11 I think). I am using MS VS2010.

I spent some time looking for a workaround. Despite not fully understanding
why this happens, the only simple solution (compiling and working) I found
is the following:

  image->mouseMoved().connect(
    boost::bind( &MyClass::OnMouseMoved, this, _1 ) );

void MyClass::OnMouseMoved( const Wt::WMouseEvent& e )
{
   m_Out->setText("You're pointing the background at "
       "(" + boost::lexical_cast<std::string>(e.widget().x) +
       "," + boost::lexical_cast<std::string>(e.widget().y) +
       ").");

}


Don't know whether others have experienced this before, but hope it helps.

Kind regards,
JON HAITZ
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to