#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
//-------------------------------------------------------------------------
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;
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;
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;
PostCreation();
- gtk_widget_realize( GTK_WIDGET(m_list) );
-
- SetBackgroundColour( parent->GetBackgroundColour() );
+ SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW ) );
SetForegroundColour( parent->GetForegroundColour() );
SetFont( parent->GetFont() );
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
- if (m_widgetStyle) ApplyWidgetStyle();
-
gtk_signal_connect( GTK_OBJECT(list_item),
"button_press_event",
(GtkSignalFunc)gtk_listbox_button_press_callback,
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 wxUSE_DRAG_AND_DROP
#ifndef NEW_GTK_DND_CODE
- if (m_dropTarget) m_dropTarget->RegisterWidget( list_item );
+ if (m_dropTarget) m_dropTarget->RegisterWidget( list_item );
#endif
#endif
#if wxUSE_TOOLTIPS
- if (m_toolTip) m_toolTip->Apply( this );
+ if (m_toolTip) m_toolTip->Apply( this );
#endif
+ }
}
void wxListBox::Append( const wxString &item )
GList *child = m_list->children;
while (child)
{
- gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL );
+ gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), wxConv_local.cWX2MB(tip), (gchar*) NULL );
child = child->next;
}
}