X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1a39f47f8e4e9662ecdecab8f38fca1342202a7..c127177f8dc31dbe99764852b8dbcc047d3ad826:/src/gtk/slider.cpp diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index a9a4e9a7d3..fb6b989378 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -18,6 +18,13 @@ #include "gdk/gdk.h" #include "gtk/gtk.h" +//----------------------------------------------------------------------------- +// idle system +//----------------------------------------------------------------------------- + +extern void wxapp_install_idle_handler(); +extern bool g_isIdle; + //----------------------------------------------------------------------------- // data //----------------------------------------------------------------------------- @@ -30,6 +37,8 @@ extern bool g_blockEventsOnDrag; static void gtk_slider_callback( GtkWidget *WXUNUSED(widget), wxSlider *win ) { + if (g_isIdle) wxapp_install_idle_handler(); + if (!win->HasVMT()) return; if (g_blockEventsOnDrag) return; @@ -92,13 +101,16 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, m_oldPos = 0.0; - if (style & wxSL_VERTICAL == wxSL_VERTICAL) - m_widget = gtk_hscale_new( (GtkAdjustment *) NULL ); - else + if (style & wxSL_VERTICAL) m_widget = gtk_vscale_new( (GtkAdjustment *) NULL ); + else + m_widget = gtk_hscale_new( (GtkAdjustment *) NULL ); - gtk_scale_set_draw_value( GTK_SCALE( m_widget ), FALSE ); - + if (style & wxSL_LABELS) + gtk_scale_set_draw_value( GTK_SCALE( m_widget ), TRUE ); + else + gtk_scale_set_draw_value( GTK_SCALE( m_widget ), FALSE ); + m_adjust = gtk_range_get_adjustment( GTK_RANGE(m_widget) ); gtk_signal_connect( GTK_OBJECT(m_adjust),