n = -1;
}
- event.m_commandInt = n;
+ event.SetInt(n);
listbox->GetEventHandler()->ProcessEvent( event );
{
n = -1;
}
- new_event.m_commandInt = n;
+ new_event.SetInt(n);
listbox->GetEventHandler()->ProcessEvent( new_event );
}
}
n = -1;
}
- event.m_commandInt = n;
+ event.SetInt(n);
// No longer required with new code in wxLB_SINGLE
// listbox->GetEventHandler()->AddPendingEvent( event );
// wxListBox
//-----------------------------------------------------------------------------
+static gint
+gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ GList *child = win->m_list->children;
+ for (child = win->m_list->children; child != NULL; child = child->next)
+ gtk_widget_show( GTK_WIDGET(child->data) );
+
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+// wxListBox
+//-----------------------------------------------------------------------------
+
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
// ----------------------------------------------------------------------------
gtk_widget_show( GTK_WIDGET(m_list) );
+ gtk_signal_connect( GTK_OBJECT(m_list), "realize",
+ GTK_SIGNAL_FUNC(gtk_listbox_realized_callback), (gpointer) this );
+
if ( style & wxLB_SORT )
{
// this will change DoAppend() behaviour
else
gtk_list_insert_items( GTK_LIST (m_list), gitem_list, pos );
- gtk_signal_connect( GTK_OBJECT(list_item), "select",
+ gtk_signal_connect_after( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
if (HasFlag(wxLB_MULTIPLE) || HasFlag(wxLB_EXTENDED))
- gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
+ gtk_signal_connect_after( GTK_OBJECT(list_item), "deselect",
GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(list_item),
gtk_signal_connect( GTK_OBJECT(list_item), "focus_out_event",
GTK_SIGNAL_FUNC(gtk_listitem_focus_out_callback), (gpointer)this );
-
ConnectWidget( list_item );
- gtk_widget_show( list_item );
-
if (GTK_WIDGET_REALIZED(m_widget))
{
+ gtk_widget_show( list_item );
+
gtk_widget_realize( list_item );
gtk_widget_realize( GTK_BIN(list_item)->child );