]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
Corrected some things in, and some thing revealed by
[wxWidgets.git] / src / gtk / listbox.cpp
index bdf69d7e36429b785ae663d6f670022f4b8ce4fa..e4936a923ef4b2096e0b66a95a237ba760add7ad 100644 (file)
@@ -26,9 +26,9 @@
 #include "wx/tooltip.h"
 #endif
 
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
-#include "gdk/gdkkeysyms.h"
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 
 //-----------------------------------------------------------------------------
 // idle system
@@ -253,7 +253,8 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
 
     event.m_commandInt = n;
 
-    listbox->GetEventHandler()->ProcessEvent( event );
+    listbox->GetEventHandler()->AddPendingEvent( event );
+//    listbox->GetEventHandler()->ProcessEvent( event );
 }
 
 //-----------------------------------------------------------------------------
@@ -326,12 +327,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
 
     gtk_widget_show( GTK_WIDGET(m_list) );
 
-    wxSize newSize = size;
-    if (newSize.x == -1)
-        newSize.x = 100;
-    if (newSize.y == -1)
-        newSize.y = 110;
-    SetSize( newSize.x, newSize.y );
+    SetSizeOrDefault( size );
 
     if ( style & wxLB_SORT )
     {
@@ -483,10 +479,10 @@ void wxListBox::GtkAddItem( const wxString &item, int pos )
                            (GtkSignalFunc)gtk_listbox_key_press_callback,
                            (gpointer)this );
 
-    gtk_widget_show( list_item );
-
     ConnectWidget( list_item );
 
+    gtk_widget_show( list_item );
+
     if (GTK_WIDGET_REALIZED(m_widget))
     {
         gtk_widget_realize( list_item );
@@ -865,7 +861,7 @@ GtkWidget *wxListBox::GetConnectWidget()
 
 bool wxListBox::IsOwnGtkWindow( GdkWindow *window )
 {
-    if (wxWindow::IsOwnGtkWindow( window )) return TRUE;
+    if (GTK_WIDGET(m_list)->window == window) return TRUE;
 
     GList *child = m_list->children;
     while (child)
@@ -938,4 +934,9 @@ void wxListBox::OnInternalIdle()
     UpdateWindowUI();
 }
 
+wxSize wxListBox::DoGetBestSize() const
+{
+    return wxSize(100, 110);
+}
+
 #endif