Hey all,

Strange bug founded. Assume we have the code below:
       // code inside some container widget
       // ...
      popupMenu_ = new Wt::WPopupMenu();
      addChild(popupMenu_);
      Wt::WSignalMapper< ItemId >* m
        = new Wt::WSignalMapper< ItemId >(popupMenu_);

      m->mapConnect
        (popupMenu_->addItem(tr("id1"))->triggered(), Id1);

      m->mapConnect
        (popupMenu_->addItem(tr("id2"))->triggered(), Id2);

      m->mapped().connect(this, &MyWidget::handlePopup);

      Wt::WPushButton* b = new Wt::WPushButton("test", this);
      b->clicked().connect(this, &MyWidget::handleClick);

  void MyWidget::handleClick(Wt::WMouseEvent me)
  {
    popupMenu_->popup(me);
  }

  void MyWidget::handlePopup(ItemID id)
  {
    Wt::WApplication* const app = wApp;
    switch(id) {
    case Id1:
      app->setInternalPath("/path/to/id1");
    case Id2:
      app->setInternalPath("/path/to/id2");
  }

When the button "test" clicked for a first time all works fine. Subsequent
clicks
does not pop up the menu. We tried to investigate the problem and find out
that the method WWidget::hide() invoked by WPopupMenu::done() has invoked
after the WObject::show() invocation when on a second and subsequent clicks
on a button and prevents pop up a menu.

Regards,
Dmitriy
------------------------------------------------------------------------------

_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to