]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
More for wxPython 2.0b9 (hopefully the last...)
[wxWidgets.git] / src / gtk / listbox.cpp
index 138fc38d96d1ed72ff6195f22c375807ebb055e9..406b583e7cac31d096bfa0ff0f1f9e551ad6e4d4 100644 (file)
@@ -17,6 +17,7 @@
 #include "wx/utils.h"
 #include "wx/intl.h"
 #include "wx/checklst.h"
+#include "wx/settings.h"
 
 #if wxUSE_TOOLTIPS
 #include "wx/tooltip.h"
 #include "gdk/gdk.h"
 #include "gtk/gtk.h"
 
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
 //-------------------------------------------------------------------------
 // conditional compilation
 //-------------------------------------------------------------------------
@@ -63,6 +71,8 @@ extern bool   g_blockEventsOnScroll;
 static gint
 gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxListBox *listbox )
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     if (g_blockEventsOnDrag) return FALSE;
     if (g_blockEventsOnScroll) return FALSE;
 
@@ -116,6 +126,8 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
 static gint
 gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     if (g_blockEventsOnDrag) return FALSE;
 
     if (!listbox->HasVMT()) return FALSE;
@@ -142,6 +154,8 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
 
 static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox *listbox )
 {
+    if (g_isIdle) wxapp_install_idle_handler();
+
     if (!listbox->HasVMT()) return;
     if (g_blockEventsOnDrag) return;
 
@@ -274,7 +288,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
 
     PostCreation();
 
-    SetBackgroundColour( parent->GetBackgroundColour() );
+    SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW ) );
     SetForegroundColour( parent->GetForegroundColour() );
     SetFont( parent->GetFont() );