Project

General

Profile

Bug #1812 ยป test.cpp

Max Quatember, 04/04/2013 02:00 PM

 
namespace
{
class DiaReject : public Wt::WDialog
{
public:
Wt::WPushButton* button;
DiaReject( Wt::WPushButton* b )
{
button = b;
auto line = new Wt::WLineEdit;
setWindowTitle( "press escape! (it should not close the dialog!)" );
line->setFocus();
contents()->addWidget( line );
}
virtual void reject() override
{
button->setText( "rejected" );
}

};
class TestDiaLineEdit
: public Wt::WApplication
{
public:
Wt::WPushButton* button;
TestDiaLineEdit( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{
button = new Wt::WPushButton( "click" );
root()->addWidget( button );
button->clicked().connect( [&](...)
{
static int c = 0;
if( c == 2 )
button->setText( "now close the browser tab, the server crashes..." );
c++;
DiaReject dia( button );
dia.exec();
});
}
};
}
    (1-1/1)