Don't refresh not yet realized widget in wxGTK wxDataViewCtrl.
If the text of any of wxDataViewCtrl cells was set before the control was realized (e.g. during its creation), the code tried to refresh the not yet shown widget resulting in GTK+ errors. Avoid this by only refreshing the tree if it's realized. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1644,6 +1644,10 @@ bool wxGtkDataViewModelNotifier::ValueChanged( const wxDataViewItem &item, unsig
|
||||
GtkTreeView *widget = GTK_TREE_VIEW(ctrl->GtkGetTreeView());
|
||||
GtkTreeViewColumn *gcolumn = GTK_TREE_VIEW_COLUMN(column->GetGtkHandle());
|
||||
|
||||
// Don't attempt to refresh not yet realized tree, it is useless
|
||||
// and results in GTK errors.
|
||||
if ( gtk_widget_get_realized(ctrl->GtkGetTreeView()) )
|
||||
{
|
||||
// Get cell area
|
||||
GtkTreeIter iter;
|
||||
iter.stamp = wxgtk_model->stamp;
|
||||
@@ -1661,6 +1665,7 @@ bool wxGtkDataViewModelNotifier::ValueChanged( const wxDataViewItem &item, unsig
|
||||
// Redraw
|
||||
gtk_widget_queue_draw_area( GTK_WIDGET(widget),
|
||||
cell_area.x - xdiff, ydiff + cell_area.y, cell_area.width, cell_area.height );
|
||||
}
|
||||
|
||||
m_internal->ValueChanged( item, model_column );
|
||||
|
||||
|
Reference in New Issue
Block a user