- wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );
-
- GtkWidget *list_item;
-
- wxString label(item);
-#if wxUSE_CHECKLISTBOX
- if (m_hasCheckBoxes)
- {
- label.Prepend(CHECKBOX_STRING);
- }
-#endif // wxUSE_CHECKLISTBOX
-
- list_item = gtk_list_item_new_with_label( label.mbc_str() );
-
- gtk_container_add( GTK_CONTAINER(m_list), list_item );
-
- gtk_signal_connect( GTK_OBJECT(list_item), "select",
- GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
-
- if (HasFlag(wxLB_MULTIPLE))
- gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
- GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
-
- gtk_signal_connect( GTK_OBJECT(list_item),
- "button_press_event",
- (GtkSignalFunc)gtk_listbox_button_press_callback,
- (gpointer) this );
-
- gtk_signal_connect_after( GTK_OBJECT(list_item),
- "button_release_event",
- (GtkSignalFunc)gtk_listbox_button_release_callback,
- (gpointer) this );
-
-#if wxUSE_CHECKLISTBOX
- if (m_hasCheckBoxes)
- {
- gtk_signal_connect( GTK_OBJECT(list_item),
- "key_press_event",
- (GtkSignalFunc)gtk_listbox_key_press_callback,
- (gpointer)this );
- }
-#endif // wxUSE_CHECKLISTBOX
-
- gtk_widget_show( list_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 (m_widgetStyle) {
- // Apply current widget style to the new list_item
- gtk_widget_set_style( GTK_WIDGET( list_item ), m_widgetStyle );
- GtkBin *bin = GTK_BIN( list_item );
- GtkWidget *label = GTK_WIDGET( bin->child );
- gtk_widget_set_style( label, m_widgetStyle );
- }
-
-#if wxUSE_DRAG_AND_DROP
- #ifndef NEW_GTK_DND_CODE
- if (m_dropTarget) m_dropTarget->RegisterWidget( list_item );
- #endif
-#endif
-
-#if wxUSE_TOOLTIPS
- if (m_tooltip) m_tooltip->Apply( this );
-#endif
- }