]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
PCX handler now working for reading (8bit and 24bit images).
[wxWidgets.git] / src / gtk / listbox.cpp
index 0b62dcb261a6ba7079a93a8dfb900e43c33a7afa..fe31b2e16d2b2610dada85197fdaea425737373f 100644 (file)
@@ -193,6 +193,13 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
 // "select" and "deselect"
 //-----------------------------------------------------------------------------
 
+static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox );
+
+static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbox )
+{
+    gtk_listitem_select_callback( widget, listbox );
+}
+
 static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -244,11 +251,12 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     m_needParent = TRUE;
     m_acceptsFocus = TRUE;
 
-    PreCreation( parent, id, pos, size, style, name );
-
-#if wxUSE_VALIDATORS
-    SetValidator( validator );
-#endif
+    if (!PreCreation( parent, pos, size ) ||
+        !CreateBase( parent, id, pos, size, style, validator, name ))
+    {
+        wxFAIL_MSG( _T("wxListBox creation failed") );
+       return FALSE;
+    }
 
     m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
     if (style & wxLB_ALWAYS_SB)
@@ -309,7 +317,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
 
         if (style & wxLB_MULTIPLE)
             gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
-              GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
+              GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
 
         gtk_signal_connect( GTK_OBJECT(list_item),
                             "button_press_event",
@@ -479,7 +487,7 @@ void wxListBox::AppendCommon( const wxString &item )
 
     if (HasFlag(wxLB_MULTIPLE))
         gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
-          GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
+          GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
 
     gtk_signal_connect( GTK_OBJECT(list_item),
                         "button_press_event",
@@ -916,7 +924,7 @@ void wxListBox::DisableEvents()
 
         if (HasFlag(wxLB_MULTIPLE))
             gtk_signal_disconnect_by_func( GTK_OBJECT(child->data),
-              GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
+              GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
 
         child = child->next;
     }
@@ -932,7 +940,7 @@ void wxListBox::EnableEvents()
 
         if (HasFlag(wxLB_MULTIPLE))
             gtk_signal_connect( GTK_OBJECT(child->data), "deselect",
-              GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
+              GTK_SIGNAL_FUNC(gtk_listitem_deselect_callback), (gpointer)this );
          
         child = child->next;
     }