Project

General

Profile

Support #4981 ยป treeview_multiline.cpp

Max Quatember, 06/15/2016 12:54 PM

 
namespace
{
class TestTreeView
: public Wt::WApplication
{
public:
TestTreeView( const Wt::WEnvironment& env )
: Wt::WApplication( env )
{
setCssTheme( "polished" );
Wt::WTreeView* treeView = new Wt::WTreeView( root() );
treeView->resize( 500, 500 );
treeView->setColumnResizeEnabled( true );
Wt::WStandardItemModel* model = new Wt::WStandardItemModel( 0, 1 );
model->setHeaderData( 0, Wt::Horizontal, std::string( "xxxxxxx" ) );
std::vector< Wt::WStandardItem* > items;
items.push_back( new Wt::WStandardItem( "yyyy\nzzzz" ) );
model->appendRow( items );
treeView->setModel( model );
treeView->setColumnWidth( 0, 120 );
}
};
}
    (1-1/1)