BEGIN_EVENT_TABLE(wxDataViewTreeCtrl,wxDataViewCtrl)
EVT_DATAVIEW_ITEM_EXPANDED(-1, wxDataViewTreeCtrl::OnExpanded)
EVT_DATAVIEW_ITEM_COLLAPSED(-1, wxDataViewTreeCtrl::OnCollapsed)
+ EVT_SIZE( wxDataViewTreeCtrl::OnSize )
END_EVENT_TABLE()
wxDataViewTreeCtrl::wxDataViewTreeCtrl()
wxDataViewTreeStore *store = new wxDataViewTreeStore;
AssociateModel( store );
store->DecRef();
- AppendIconTextColumn( "", 0, wxDATAVIEW_CELL_INERT, 200 );
+
+ wxDataViewColumn *col = AppendIconTextColumn( "", 0, wxDATAVIEW_CELL_INERT, 40 );
+
+#if !defined(__WXGTK20__)
+ wxSize cient_size = GetClientSize();
+ col->SetWidth( size.x );
+#endif
}
wxDataViewTreeCtrl::~wxDataViewTreeCtrl()
return GetStore()->InsertContainer( parent, previous, text, icon, expanded, data );
}
-
void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event )
{
if (m_imageList) return;
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
{
#if !defined(__WXGTK20__)
+ wxSize size = GetClientSize();
+ wxDataViewColumn *col = GetColumn( 0 );
+ col->SetWidth( size.x );
#endif
}