Project

General

Profile

Support #1711 ยป test_popup.cpp

Max Quatember, 02/20/2013 12:05 PM

 
namespace
{
class TestPopupHide
: public Wt::WApplication
{
public:
TestPopupHide( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{
root()->setAttributeValue( "oncontextmenu", "event.cancelBubble = true; event.returnValue = false; return false;" );

auto c = new Wt::WContainerWidget( root() );
c->resize( 1000, 1000 );
c->mouseMoved().connect( [&]( const Wt::WMouseEvent& e ){ } );

auto child = new Wt::WText( "right click", c );
child->mouseWentUp().connect( [&]( const Wt::WMouseEvent& e )
{
auto popup = new Wt::WPopupMenu;
popup->addItem( "is not shown..." );
popup->popup( e );
});
}
};
}
    (1-1/1)