X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5be07d450c6daccf4dbaa9030493df7c0149111..13393ab6233f67b0afe3e02bc6bc3229b8104f43:/src/gtk1/listbox.cpp diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 402a02c244..138fc38d96 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -274,8 +274,6 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, PostCreation(); - gtk_widget_realize( GTK_WIDGET(m_list) ); - SetBackgroundColour( parent->GetBackgroundColour() ); SetForegroundColour( parent->GetForegroundColour() ); SetFont( parent->GetFont() ); @@ -411,8 +409,6 @@ void wxListBox::AppendCommon( const wxString &item ) gtk_signal_connect( GTK_OBJECT(list_item), "deselect", GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this ); - if (m_widgetStyle) ApplyWidgetStyle(); - gtk_signal_connect( GTK_OBJECT(list_item), "button_press_event", (GtkSignalFunc)gtk_listbox_button_press_callback, @@ -430,15 +426,23 @@ void wxListBox::AppendCommon( const wxString &item ) ConnectWidget( list_item ); + if (GTK_WIDGET_REALIZED(m_widget)) + { + gtk_widget_realize( list_item ); + gtk_widget_realize( GTK_BIN(list_item)->child ); + + if (m_widgetStyle) ApplyWidgetStyle(); + #if wxUSE_DRAG_AND_DROP #ifndef NEW_GTK_DND_CODE - if (m_dropTarget) m_dropTarget->RegisterWidget( list_item ); + if (m_dropTarget) m_dropTarget->RegisterWidget( list_item ); #endif #endif #if wxUSE_TOOLTIPS - if (m_toolTip) m_toolTip->Apply( this ); + if (m_toolTip) m_toolTip->Apply( this ); #endif + } } void wxListBox::Append( const wxString &item ) @@ -774,7 +778,7 @@ void wxListBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) GList *child = m_list->children; while (child) { - gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL ); + gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConv_local.cWX2MB(tip), (gchar*) NULL ); child = child->next; } }