Guest User

Untitled

a guest
Sep 7th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1.       WWidget* Menu ()
  2.       {
  3.          wApp->internalPathChanged().connect(this, &Dialog::OnPathChanged);
  4.  
  5.          auto menu = new WMenu(Vertical);
  6.          menu->setRenderAsList(true);
  7.          menu->setInternalPathEnabled("/page");
  8.          menu->itemSelected().connect (this, &Dialog::OnMenuClicked);
  9.  
  10.          menu->addItem(WString("Boooom!"), nullptr)->setPathComponent("boom");
  11.  
  12.          return menu;
  13.       }
  14.  
  15.       void OnPathChanged (const std::string& path)
  16.       {
  17.          WMessageBox::show(__FUNCTION__, path, Ok);
  18.       }
  19.  
  20.       void OnMenuClicked ()
  21.       {
  22.          WMessageBox::show(__FUNCTION__, "I got the click :-)", Ok);
  23.       }
Advertisement
Add Comment
Please, Sign In to add comment