+ m_pos = value;
+ m_scrollEventType = GTK_SCROLL_NONE;
+
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, validator, name ))
+ {
+ wxFAIL_MSG( wxT("wxSlider creation failed") );
+ return false;
+ }
+
+ if (style & wxSL_VERTICAL)
+ m_widget = gtk_vscale_new( NULL );
+ else
+ m_widget = gtk_hscale_new( NULL );
+ g_object_ref(m_widget);
+
+ gtk_scale_set_draw_value(GTK_SCALE (m_widget), (style & wxSL_LABELS) != 0);
+ // Keep full precision in position value
+ gtk_scale_set_digits(GTK_SCALE (m_widget), -1);
+
+ if (style & wxSL_INVERSE)
+ gtk_range_set_inverted( GTK_RANGE(m_widget), TRUE );
+
+ g_signal_connect(m_widget, "button_press_event", G_CALLBACK(gtk_button_press_event), this);
+ g_signal_connect(m_widget, "button_release_event", G_CALLBACK(gtk_button_release_event), this);
+ g_signal_connect(m_widget, "move_slider", G_CALLBACK(gtk_move_slider), this);
+ g_signal_connect(m_widget, "format_value", G_CALLBACK(gtk_format_value), NULL);
+ g_signal_connect(m_widget, "value_changed", G_CALLBACK(gtk_value_changed), this);
+ gulong handler_id = g_signal_connect(m_widget, "event_after", G_CALLBACK(gtk_event_after), this);
+ g_signal_handler_block(m_widget, handler_id);
+
+ SetRange( minValue, maxValue );
+
+ // don't call the public SetValue() as it won't do anything unless the
+ // value really changed
+ GTKSetValue( value );
+
+ m_parent->DoAddChild( this );