Property Widget Facility

Name

Property Widget Facility -- Easy property widget creation.

Synopsis


struct      property_t;
properties_t* properties_create             (const property_t property[],
                                             const gint num_properties,
                                             void (*notify) (void));
gint        properties_destroy              (properties_t *properties);
GtkWidget*  properties_get_widget           (const properties_t *properties);
gfloat*     properties_get_values           (const properties_t *properties);
gint        properties_set_values           (properties_t *properties,
                                             const gfloat value[]);
struct      properties_t;

Description

This functions allow the creation and management of a widget to show and get numerical properties from the user without having to learn how to create a widget with Gtk+. It is specialy usefull within algorithms allowing the user with no Gtk+ knowledge to write algorithms which properties.

Details

struct property_t

typedef struct {
	gchar *label;	/* Some text to identify de value */
	gfloat min;	/* The minimun value */
	gfloat max;	/* The maximun value */
	gfloat step;	/* Value increments allowed */
} property_t;

Descrives a single property value.


properties_create ()

properties_t* properties_create             (const property_t property[],
                                             const gint num_properties,
                                             void (*notify) (void));

Creates a GtkWidget for the properties described in property.

property : properties descriptions.
num_properties : number of elemente in property.
notify : to be called when the properties change.
Returns : a pointer which identifies the newly created properties_t.


properties_destroy ()

gint        properties_destroy              (properties_t *properties);

Destroys the properties widget, freeing all it's memory.

properties : a properties pointer obtained with properties_create.
Returns : nothing interesting.


properties_get_widget ()

GtkWidget*  properties_get_widget           (const properties_t *properties);

Retrives the widget created to hold all the properties.

properties : a properties pointer obtained with properties_create.
Returns : A pointer to the widget.


properties_get_values ()

gfloat*     properties_get_values           (const properties_t *properties);

Retrives the current values of all the properties representied in properties.

properties : a properties pointer obtained with properties_create.
Returns : An array with the values.


properties_set_values ()

gint        properties_set_values           (properties_t *properties,
                                             const gfloat value[]);

Sets the values of all the properties stored in properties.

properties : a properties pointer obtained with properties_create.
value : and array with the values.
Returns : nothing interesting.


struct properties_t

typedef struct {
	void (*notify)(void);	/* will be called when ever a properties
				 * change.*/
	GtkWidget *widget;	/* is the main widget.*/
	gint num_properties;	/* number of entry and value elements */
	GtkWidget **entry;	/* is an array of all entry widgets */
	gfloat *value;		/* is an array of all property values */
} properties_t;

Descrives everything there is to know about a properties widget.

NOTE: it's fields should not be accessed directly.