PhatFanSlider

Name

PhatFanSlider -- a base class for PhatHFanSlider and PhatVFanSlider

Synopsis



            PhatFanSlider;
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);
void        phat_fan_slider_set_inverted    (PhatFanSlider *slider,
                                             gboolean inverted);
gboolean    phat_fan_slider_get_inverted    (PhatFanSlider *slider);


Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----PhatFanSlider
                     +----PhatVFanSlider
                     +----PhatHFanSlider

Implemented Interfaces

PhatFanSlider implements AtkImplementorIface.

Signal Prototypes


"changed"   void        user_function      (PhatFanSlider *slider,
                                            gpointer user_data);
"value-changed"
            void        user_function      (PhatFanSlider *slider,
                                            gpointer user_data);

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.

You can change the colors that a given fanslider uses. Fansliders use widget->style->base_gc[GTK_STATE_SELECTED] for the foreground color, and widget->style->dark_gc[GTK_STATE_NORMAL] for the background color. Adjusting these elements of the widget's style will change the way the fanslider draws.

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

PhatFanSlider

typedef struct _PhatFanSlider PhatFanSlider;

The PhatFanSlider-struct struct contains private data only, and should be accessed using the functions below.


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 to fit within them. 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 its 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 its current value and its range of allowable values. 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


phat_fan_slider_set_inverted ()

void        phat_fan_slider_set_inverted    (PhatFanSlider *slider,
                                             gboolean inverted);

Sets in which direction the fanslider should draw increasing values. By default, horizontal fansliders draw low to high from left to right, and vertical fansliders draw from bottom to top. You can reverse this behavior by setting inverted to TRUE.

slider :

a PhatFanSlider

inverted :

TRUE to invert the fanslider


phat_fan_slider_get_inverted ()

gboolean    phat_fan_slider_get_inverted    (PhatFanSlider *slider);

Determines whether slider is inverted or not.

slider :

a PhatFanSlider

Returns :

TRUE if slider is inverted

Signals

The "changed" signal

void        user_function                  (PhatFanSlider *slider,
                                            gpointer user_data);

The "changed" signal is emitted when any parameter of the slider's adjustment changes, except for the value parameter.

slider :

the object on which the signal was emitted

user_data :

user data set when the signal handler was connected.


The "value-changed" signal

void        user_function                  (PhatFanSlider *slider,
                                            gpointer user_data);

The "value-changed" signal is emitted when the value of the slider's adjustment changes.

slider :

the object on which the signal was emitted

user_data :

user data set when the signal handler was connected.

See Also

PhatHFanSlider and PhatVFanSlider to create instances of PhatFanSlider.