wxRect renderrect( rect.x, rect.y, rect.width, rect.height );
wxWindowDC* dc = (wxWindowDC*) cell->GetDC();
wxWindowDCImpl *impl = (wxWindowDCImpl *) dc->GetImpl();
- if (impl->m_gdkwindow == NULL)
- {
- impl->m_gdkwindow = window;
- impl->SetUpDC();
- }
+ // Reinitilise GDK window everytime as drawing can also
+ // be done into DnD drop window.
+ impl->m_gdkwindow = window;
+ impl->SetUpDC();
int state = 0;
if (flags & GTK_CELL_RENDERER_SELECTED)
m_window = window;
- m_context = window->GtkGetPangoDefaultContext();
+ m_context = window->GTKGetPangoDefaultContext();
m_layout = pango_layout_new( m_context );
m_fontdesc = pango_font_description_copy( widget->style->font_desc );
m_renderer = (GtkCellRenderer*) gtk_cell_renderer_combo_new();
GtkListStore *store = gtk_list_store_new( 1, G_TYPE_STRING );
- size_t n;
- for (n = 0; n < m_choices.GetCount(); n++)
- gtk_list_store_insert_with_values( store, NULL, n, 0, m_choices[n].utf8_str(), -1 );
+ for (size_t n = 0; n < m_choices.GetCount(); n++)
+ {
+ gtk_list_store_insert_with_values(
+ store, NULL, n, 0,
+ static_cast<const char *>(m_choices[n].utf8_str()), -1 );
+ }
g_object_set (m_renderer,
"model", store,
GValue gvalue = { 0, };
g_value_init( &gvalue, G_TYPE_STRING );
g_object_get_property( G_OBJECT(m_renderer), "text", &gvalue );
- wxString temp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), const_cast<wxDataViewTextRenderer*>(this)->GetOwner()->GetOwner()->GetFont() );
+ wxString temp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ),
+ const_cast<wxDataViewChoiceRenderer*>(this)->GetOwner()->GetOwner()->GetFont() );
g_value_unset( &gvalue );
value = temp;
wxPrintf( "temp %s\n", temp );
m_widget = gtk_scrolled_window_new (NULL, NULL);
g_object_ref(m_widget);
- GtkScrolledWindowSetBorder(m_widget, style);
+ GTKScrolledWindowSetBorder(m_widget, style);
m_treeview = gtk_tree_view_new();
gtk_container_add (GTK_CONTAINER (m_widget), m_treeview);
gtk_tree_view_set_rules_hint( GTK_TREE_VIEW(m_treeview), (style & wxDV_ROW_LINES) != 0 );
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_show (m_treeview);
m_parent->DoAddChild( this );