}
if (style & wxSL_VERTICAL)
- m_widget = gtk_vscale_new( (GtkAdjustment *) NULL );
+ m_widget = gtk_vscale_new( NULL );
else
- m_widget = gtk_hscale_new( (GtkAdjustment *) NULL );
+ 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
void wxSlider::SetRange( int minValue, int maxValue )
{
m_blockScrollEvent = true;
+ if (minValue == maxValue)
+ maxValue++;
gtk_range_set_range(GTK_RANGE (m_widget), minValue, maxValue);
gtk_range_set_increments(GTK_RANGE (m_widget), 1, (maxValue - minValue + 9) / 10);
m_blockScrollEvent = false;