Project

General

Profile

Support #4981 ยป treeview_multiline.cpp

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

 
1
namespace
2
{
3
	class TestTreeView 
4
		: public Wt::WApplication
5
	{
6
	public:
7
		TestTreeView( const Wt::WEnvironment& env )
8
			: Wt::WApplication( env )
9
		{
10
			setCssTheme( "polished" );
11
			Wt::WTreeView* treeView = new Wt::WTreeView( root() );
12
			treeView->resize( 500, 500 );
13
			treeView->setColumnResizeEnabled( true );
14
			Wt::WStandardItemModel* model = new Wt::WStandardItemModel( 0, 1 );
15
			model->setHeaderData( 0, Wt::Horizontal, std::string( "xxxxxxx" ) );
16
			std::vector< Wt::WStandardItem* > items;
17
			items.push_back( new Wt::WStandardItem( "yyyy\nzzzz" ) );
18
			model->appendRow( items );
19
			treeView->setModel( model );
20
			treeView->setColumnWidth( 0, 120 );
21
		}
22
	};
23
}
    (1-1/1)