GiwCompass
GiwCompass - A compass widget


Synopsis
#include <gtkcompass.h>


                        GiwCompass;
GtkWidget*     giw_compass_new                      
                (void);
gfloat               giw_compass_get_angle                              (GiwCompass *compass);
void                 giw_compass_set_angle                              (GiwCompass *compass, gfloat angle);
void                 giw_compass_set_directions                       (GiwCompass *compass, guchar north, guchar south, guchar west, guchar east);
void                 giw_compass_enable_mouse                       (GiwCompass *compass, gboolean option);

Object Hierarchy
GObject
   +----GtkObject
           +----GtkWidget
                    +----GiwCompass

Signal Prototypes
"angle_changed"
  void         user_function      (GiwCompass *compass, gpointer user_data);



Description

GiwCompass is a simple compass, with the indicator and the four directions.
It can be created with a giw_compass_new(), an cofigured with the functions below.

Details

GiwCompass
typedef struct GiwCompass _GiwCompass

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

giw_compass_new()

GtkWidget*     giw_compass_new                                       (void);

Creates a new compass, with all default options.

Returns: a new compass.

giw_compass_get_angle()

gfloat               giw_compass_get_angle                              (GiwCompass *compass);

Gets the angle's value. It's a angle in radians, relative to the 3 o'clock position (east).

compass: A compass.
Returns: The angle's value.
giw_compass_set_angle()

void                 giw_compass_set_angle                              (GiwCompass *compass, gfloat angle);

Sets the angle's value, in radians relative to the 3 o'clock position (east). The default value is 0.


compass: A compass.
angle: The desired angle.

giw_compass_set_directions()

void                 giw_compass_set_directions                       (GiwCompass *compass, guchar north, guchar south, guchar west, guchar east);

Sets the characters that indicates the four direction. The default is 'N' for north,
'S' for south, 'W' for west and 'E' for east.

compass: A compass.
north: The character to represent the north direction.
south: The character to represent the south direction.
west: The character to represent the west direction.
east: The character to represent the east direction.

giw_compass_enable_mouse()

void                 giw_compass_enable_mouse                              (GiwCompass *compass, gboolean option );

Enable, or disable the option of using mouse on changing the angle. The default is disabled.


compass: A compass.
option: FALSE to disabe mouse, TRUE to enable.

Signals

The "angle_changed" signal
void        user_function                  (GiwCompass *compass, gpointer user_data);

compass: the object which received the signal.
user_data: user data set when the signal handler was connected.