GiwTank
GiwTank - A tank widget


Synopsis
#include <giwtank.h>


                           GiwTank;
GtkWidget*        giw_tank_new                        
              (GtkAdjustment *adjustment);
GtkWidget*        giw_tank_new_with_adjustment          (gdouble value, gdouble lower, gdouble upper);
void                    giw_tank_set_value                              (GiwTank *tank, gdouble value);  
gdouble              giw_tank_get_value                              (GiwTank *tank);  
GtkAdjustment* giw_tank_get_adjustment                    (GiwTank *tank);
void                    giw_tank_set_adjustment                     (GiwTank *tank, GtkAdjustment *adjustment);
void                    giw_tank_set_legend_digits                 (GiwTank *tank, int digits);
void          
         giw_tank_show_legends                      (GiwTank *tank, char option);
void                    giw_tank_set_major_ticks_number     (GiwTank *tank, gint number);
void                    giw_tank_set_minor_ticks_number     (GiwTank *tank, gint number);

Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwTank

Description

GiwTank is a tank like a mercury tank. It has the column (like the mercury column) and the legends, a title and a label representing the current value.
It can be created with a giw_tank_new(), an cofigured with the functions below.
The receive signals when the value is changed, get the adjustment of the tank and receive the signal from it.

Details

GiwTank
typedef struct GiwTank _GiwTank

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

giw_tank_new()

GtkWidget*     giw_tank_new                         (void);

Creates a new tank, with all default options.

Returns: a new tank.

giw_tank_new_with_adjustment()

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

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

min: The lower value.
upper: The upper value.
lower: The initial value.
Returns: a new tank.

giw_tank_get_adjustment()

GtkAdjustment*    giw_tank_get_adjustment               (GiwTank *tank);

Gets the adjusment that the tank uses.


tank: A tank.
Return
: The adjusment.

giw_tank_set_adjustment()

void                       giw_tank_set_adjustment               (GiwTank *tank, GtkAdjustment *adjustment);

Sets a new adjusment to be used.


tank: A tank.
adjustment
: The new adjusment.
giw_tank_set_value()

void                 giw_tank_set_value                (GiwTank *tank, gdouble value);  

Sets the value (the size of the column) of the tank,  is has to be between the min_value and max_value (wich can be set with the gtk_temometer_set_min_value and
gtk_temometer_set_max_value), or nothing will be drawn. The default value is 50.

tank: A tank.
value: The new value.

giw_tank_get_value()

gdouble            giw_tank_set_value                (GiwTank *tank);  

Gets the value (the size of the column) of the tank.

tank: A tank.
Returns: The value.

giw_tank_set_legend_digits()

void                 giw_tank_set_legend_digits   (GiwTank *tank, int digits);

Sets the number os digits to be used by the legends (counting the "." and the signal "-" if exists). It has to bigger than 1. The default is 5.


tank: A tank.
digits: The number of digits.

giw_tank_show_legends()

void                 giw_tank_show_legends        (GiwTank *tank, char option);

Shows, or hides the legends.

tank: A tank.
option: TRUE to show the legends, FALSE  for hiding it.

giw_tank_set_major_ticks_number()

void                 giw_tank_set_major_ticks_number     (GiwTank *tank, gint number);

Sets the number oj major ticks to be drawn in all the tank, if it's 0, there are no ticks (and no legends too).

tank: A tank.
option: The number of ticks desired.

giw_tank_set_minor_ticks_number()

void                 giw_tank_set_minor_ticks_number     (GiwTank *tank, gint number);

Sets the number oj minor ticks to be drawn between each major ticks, if it's 0 there are no minor ticks.

tank: A tank.
option: The number of minor ticks desired.