Project

General

Profile

Bug #4749 ยป Example.cpp

Markus S, 02/16/2016 01:33 PM

 
class TestTreeView
: public Wt::WApplication
{
public:
TestTreeView( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{
Wt::WTreeView* treeView = new Wt::WTreeView( root() );
treeView->resize( 500, 500 );

Wt::WStandardItemModel* model = new Wt::WStandardItemModel( 0, 1 );
model->setHeaderData( 0, Wt::Horizontal, std::string( "xxxxxxx" ) );

for( auto i = 0; i < 500; i++ )
model->appendRow( { new Wt::WStandardItem( std::to_string( i ) ) } );

treeView->setModel( model );
treeView->setSelectionMode( Wt::SelectionMode::SingleSelection );
treeView->doubleClicked().connect( []( ... ) { Wt::WMessageBox::show( "Popup", "Popup", Wt::Ok ); } );
}
};
    (1-1/1)