GiwKnob
GiwKnob - A knob widget


Synopsis
#include <giwknob.h>


                       
      GiwKnob;
GtkWidget*   
        giw_knob_new                                  (GtkAdjustment *adjustment);
GtkWidget*    
       giw_knob_new_with_adjustment     (gdouble value, gdouble lower, gdouble upper);
gdouble                 giw_knob_get_value                         (GiwKnob *knob);
void                       giw_knob_set_value                         (GiwKnob *knob, gdouble value);
GtkAdjustment*    giw_knob_get_adjustment               (GiwKnob *knob);
void                       giw_knob_set_adjustment               (GiwKnob *knob, GtkAdjustment *adjustment);
void                       giw_knob_set_legends_digits          (GiwKnob *knob, guint digits_number);
void                       giw_knob_set_ticks_number            (GiwKnob *knob, guint major, guint minor);
void                       giw_knob_set_mouse_policy            (GiwKnob *knob, GiwKnobMousePolicy policy);
void                       giw_knob_set_title                            (GiwKnob *knob, gchar *str);


Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwKnob

Description

GiwKnob is a knob, with the legends and the pointer.
It can be created with a giw_knob_new(), an cofigured with the functions below. If you want to connect signals with it, you have to connect them to the adjustment it uses, wich can be acessed by
giw_knob_get_adjustment.   

Details

GiwKnob
typedef struct GiwKnob _GiwKnob

The GiwKnob struct contains private data only, and should be manipulated using the functions below.

giw_knob_new()

GtkWidget*     giw_knob_new                                       (GtkAdjustment *adjustment);

Creates a new knob, with all default options and the adjustment sent as a parementer (only the fields value, lower and upper are used).

adjustment: The adjustment to be used (it will define the value, and the lower and upper values of the knob).
Returns: a new knob.

giw_knob_new_with_adjustment()

GtkWidget*           giw_knob_new_with_adjustment    (gdouble value, gdouble lower, gdouble upper);

A convenience function, wich don't need to receive a adjustment as paramenter, but his fields.

value: The initial value.
lower: The lower value.
upper: The upper value.
Returns: A new knob.

giw_knob_get_value()

gdouble                 giw_knob_get_value                         (GiwKnob *knob);

Gets the current value of the knob.


knob: A knob.
Return: The value.

giw_knob_set_value()

void                       giw_knob_set_value                         (GiwKnob *knob, gdouble value);

Sets the current value of the knob.


knob: A knob.
value
: The desired value.

giw_knob_get_adjustment()

GtkAdjustment*    giw_knob_get_adjustment               (GiwKnob *knob);

Gets the adjusment that the knob uses.


knob: A knob.
Return
: The adjusment.

giw_knob_set_adjustment()

void                       giw_knob_set_adjustment               (GiwKnob *knob, GtkAdjustment *adjustment);

Sets a new adjusment to be used.


knob: A knob.
adjustment
: The new adjusment.

giw_knob_set_legends_digits()

void                       giw_knob_set_legends_digits          (GiwKnob *knob, guint digits_number);

Sets the number of digits that the legends will use (including the "." and "-" if it exists).


knob: A knob.
digits_number
: The number of digits.

giw_knob_set_ticks_number()

void                       giw_knob_set_ticks_number            (GiwKnob *knob, guint major, guint minor);

Sets the number ticks in the knob.


knob: A knob.
major
: The number of major ticks in the knob.
minor: The number of minor ticks between each two major ticks.

giw_knob_set_mouse_policy()

void                       giw_knob_set_mouse_policy            (GiwKnob *knob, GiwKnobMousePolicy policy);

Sets the policy to use mouse to change the knob's value.
The default option is GIW_KNOB_MOUSE_DISABLED.

knob: A knob.
policy
: The chosen policy to be used.

enum GiwKnobMousePolicy

typedef enum{
  GIW_KNOB_MOUSE_DISABLED,
  GIW_KNOB_MOUSE_AUTOMATICALLY,
  GIW_KNOB_MOUSE_DELAYED
}GiwKnobMousePolicy;

Used to set the way the mouse will be used.
 
   
GIW_KNOB_MOUSE_DISABLED                Mouse can't be used to change value.
    GIW_KNOB_MOUSE_AUTOMATICALLY    The pointer folows mouse aftre a button is pressed.
    GIW_KNOB_MOUSE_DELAYED                 The pointer assumes mouse position only when the button is relased.

giw_knob_set_title()

void                       giw_knob_set_title                            (GiwKnob *knob, gchar *str);

Sets the title, it it be in the bottom of the knob. The not show any title, set it to NULL.

knob: A knob.
str
: The string with the title.