Re: Vertical Slider



if you don't need to display the value next to the slider 
you can simply create the slider with range from 0 to 72
and substract 60 at the callback
and call gtk_scale_set_draw_value () in order not to display the value
next to the slider

On Tue, 25 Jul 2000, Hugo Villeneuve wrote:

> Hi,
> 
> 	I want to have a vertical slider for a volume control, with a range of
> -60 to +12. I want the -60 to be in the bottom, and the +12 on the top.
> If I use the following code, the slider is correct except the -60 is on
> top, and the +12 is in the bottom:
> 
>   AdjustVolume = GTK_OBJECT( gtk_adjustment_new( 0, -60, 12, 1, 10, 0 )
> );
>   gtk_signal_connect( AdjustVolume, "value_changed", GTK_SIGNAL_FUNC(
> ChangeVolume ), NULL );
>   Slider = gtk_vscale_new( GTK_ADJUSTMENT( AdjustVolume ) );
>   gtk_scale_set_digits( GTK_SCALE( Slider ), 0 );
>  
> 	If I invert the -60 and +12 in the first line of code, the slider
> doesn't work anymore (it<s value is fixed at +12). Anyone have an idea
> how I can do that?
> 
> 	Hugo.
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]