PhatFanslider

Name

PhatFanslider -- a base class for PhatHFanslider and PhatVFanslider

Synopsis



void        phat_fan_slider_set_value       (PhatFanSlider *slider,
                                             double value);
double      phat_fan_slider_get_value       (PhatFanSlider *slider);
void        phat_fan_slider_set_range       (PhatFanSlider *slider,
                                             double lower,
                                             double upper);
void        phat_fan_slider_get_range       (PhatFanSlider *slider,
                                             double *lower,
                                             double *upper);
void        phat_fan_slider_set_adjustment  (PhatFanSlider *slider,
                                             GtkAdjustment *adjustment);
GtkAdjustment* phat_fan_slider_get_adjustment
                                            (PhatFanSlider *slider);

Description

The PhatFanslider widget family provides a slider widget for retrieving floating point values from the user. The cool thing about fansliders is that the user can have a great amount of precision in a very small space. After depressing the left mouse button on a fanslider, the user can then drag the pointer away from the widget, causing a "fan" to popup which indicates the new scale they are working with. The farther out the pointer is drawn, the greater the size of the fan and the level of precision.

The fansliders work like most other numerical entry widgets; if you know how to use a GtkSpinbutton, you know how to use a PhatFanslider. If not, check out the GTK+-2.0 tutorial. The only notable operational difference is that fansliders have no step parameters.

PhatFanslider is an abstract base class, from which PhatHFanslider and PhatVFanslider are derived. To create a new fanslider, call either phat_vfanslider_new() or phat_hfanslider_new().

Details

phat_fan_slider_set_value ()

void        phat_fan_slider_set_value       (PhatFanSlider *slider,
                                             double value);

Sets the current value of the slider. If the value is outside the range of values allowed by slider, it will be clamped. The slider emits the "value-changed" signal if the value changes.

slider :

a PhatFanSlider

value :

a new value for the slider


phat_fan_slider_get_value ()

double      phat_fan_slider_get_value       (PhatFanSlider *slider);

Retrieves the current value of the slider.

slider :

a PhatFanSlider

Returns :

current value of the slider.


phat_fan_slider_set_range ()

void        phat_fan_slider_set_range       (PhatFanSlider *slider,
                                             double lower,
                                             double upper);

Sets the range of allowable values for the slider, and clamps the slider's current value to be between lower and upper.

slider :

a PhatFanSlider

lower :

lowest allowable value

upper :

highest allowable value


phat_fan_slider_get_range ()

void        phat_fan_slider_get_range       (PhatFanSlider *slider,
                                             double *lower,
                                             double *upper);

Places the range of allowable values for slider into lower and upper. Either variable may be set to NULL if you are not interested in it's value.

slider :

a PhatFanSlider

lower :

retrieves lowest allowable value

upper :

retrieves highest allowable value


phat_fan_slider_set_adjustment ()

void        phat_fan_slider_set_adjustment  (PhatFanSlider *slider,
                                             GtkAdjustment *adjustment);

Sets the adjustment used by slider. Every PhatFanSlider uses an adjustment to store it's current value and it's range of allowable values. If slider already has an adjustment (and it always will), it will g_object_unref() it's current adjustment before using the new one. If adjustment is NULL, a new adjustment with a value of zero and a range of [-1.0, 1.0] will be created.

slider :

a PhatFanSlider

adjustment :

a GtkAdjustment


phat_fan_slider_get_adjustment ()

GtkAdjustment* phat_fan_slider_get_adjustment
                                            (PhatFanSlider *slider);

Retrives the current adjustment in use by slider.

slider :

a PhatFanSlider

Returns :

slider's current GtkAdjustment

See Also

PhatHFanslider and PhatVFanslider to create instances of PhatFanslider.