- wxDataViewCtrl *dv = tree_model->internal->GetOwner();
- wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() );
- // TODO event.SetDataViewColumn( column );
- event.SetModel( dv->GetModel() );
- dv->GetEventHandler()->ProcessEvent( event );
+ if (gs_lastLeftClickHeader)
+ {
+ wxDataViewCtrl *dv = tree_model->internal->GetOwner();
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, dv->GetId() );
+ event.SetDataViewColumn( gs_lastLeftClickHeader );
+ event.SetModel( dv->GetModel() );
+ dv->GetEventHandler()->ProcessEvent( event );
+ }
+
+ gs_lastLeftClickHeader = NULL;