-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, my website have many "menus".  To reduce the code, I would create a
function to create menus automatically.

Is working, but I can't pass boost::bind or std::bind via parameter to
the function .connect(...)

Function:
template <class F>
void WtApplication::menuMain(WStackedWidget*& sw, WMenu*& mM, const F&
conn) {
  mM = new WMenu(sw, Wt::Vertical, 0);
  mM->setRenderAsList(true);
  mM->setInternalPathEnabled();
        //mM->itemSelected().connect(this, &WtApplication::upmTools); // this
WORK, but I need change the function name
  mM->itemSelected().connect(conn); // FIX
  mM->setStyleClass("menu");
}

creating a menu:
menuMain(sw, mTools_, boost::bind(&WtApplication::upmTools, this));

// OR

function:
void WtApplication::menuMain(WStackedWidget*& sw, WMenu*& mM,
std::function< ??? >) { // FIX
        ...
        mM->itemSelected().connect(conn); // FIX
}

creating a menu:
menuMain(sw, mTools_, std::bind(&WtApplication::upmTools, this));

Please, does anyone know how to do this?

Tks,
John
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJRFKZRAAoJEOjf7XlrDgBA08QH/11JPQsxP2JwHKh6BKealBS8
a38dzomvCbGFd35nPMvsTFpuoXe64qoRosKZ+4kWKtIvFlw2z5bolpc+jNEU5TjB
OfqEBbrm9k7OSV8jxu8XCyE9VkAKUpM3n9rQcg/bwbN/cskz9xvC0KL+yjCiLI4m
A3oLl1XXPFMCo0aLipG88FJgbbOe2cViARu3SBuCh/Mbs7eVUQTNiVkjsHtUW6Vn
LtPqMJUFwK9XOu21B6JyTHttDC40d76voHi1vx1x0JzyHmGU1ChbSsUTpKA6kvPD
v2sK9of7flxBr3NwD7LDVyqwcmphqT7i2pn7E/SxDcb4Q2VrK40v4dHKnD5Anj4=
=iz7Y
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to