Synopsis

#include <ntd-widgets.h>

struct              NtdLed;

GtkWidget *         ntd_led_new                         (void);
GtkWidget *         ntd_led_new_with_label              (const gchar *label);

const gchar *       ntd_led_get_label                   (NtdLed *led);
void                ntd_led_set_label                   (NtdLed *led,
                                                         const gchar *label);
gboolean            ntd_led_get_tristate                (NtdLed *led);
void                ntd_led_set_tristate                (NtdLed *led,
                                                         gboolean tristate);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----NtdLed
                                       +----NtdSwitch

Implemented Interfaces

NtdLed implements AtkImplementorIface, GtkBuildable and NtdDigital.

Properties

  "label"                    gchar*                : Read / Write / Construct
  "state"                    NtdDigitalState       : Read / Write / Construct
  "tristate"                 gboolean              : Read / Write / Construct

Style Properties

  "icon-border"              gint                  : Read
  "icon-spacing"             gint                  : Read

Description

Details

struct NtdLed

struct NtdLed;

ntd_led_new ()

GtkWidget *         ntd_led_new                         (void);

Creates a new NtdLed widget.

Returns :

the newly created widget.

ntd_led_new_with_label ()

GtkWidget *         ntd_led_new_with_label              (const gchar *label);

Creates a new NtdLed widget with a GtkLabel as child widget.

label :

the text to show.

Returns :

the newly created widget.

ntd_led_get_label ()

const gchar *       ntd_led_get_label                   (NtdLed *led);

Retrieves the label of the led.

led :

a NtdLed widget.

Returns :

a pointer to the label, or NULL if it does not exist. This string points to internally allocated storage in the widget and must not be freed.

ntd_led_set_label ()

void                ntd_led_set_label                   (NtdLed *led,
                                                         const gchar *label);

Sets the text of the label of the led to label.

This will also clear any previously set child widgets.

led :

a NtdLed widget.

label :

the new label content.

ntd_led_get_tristate ()

gboolean            ntd_led_get_tristate                (NtdLed *led);

Retrieves the tristate flag from a NtdLed widget, that is it returns TRUE if led is a led that can assume three discrete states. Take a look to ntd_led_set_tristate() for a description on what is a tristate led.

led :

a NtdLed.

Returns :

TRUE if the widget is a tristate led.

ntd_led_set_tristate ()

void                ntd_led_set_tristate                (NtdLed *led,
                                                         gboolean tristate);

Sets the tristate flag to get a tristate NtdLed widget.

A tristate led can assume three discrete states: NTD_DIGITAL_ON, NTD_DIGITAL_UNDEF and NTD_DIGITAL_OFF.

led :

a NtdLed.

tristate :

TRUE to get tristate leds.

Property Details

The "label" property

  "label"                    gchar*                : Read / Write / Construct

Text of the label, if the led contains a label widget.

Default value: NULL


The "state" property

  "state"                    NtdDigitalState       : Read / Write / Construct

State assumed by the digital signal.

Default value: NTD_DIGITAL_UNDEF


The "tristate" property

  "tristate"                 gboolean              : Read / Write / Construct

Specify if the widget can show an undefined state (can be in %NTD_DIGITAL_UNDEF state).

Default value: FALSE

Style Property Details

The "icon-border" style property

  "icon-border"              gint                  : Read

Empty space around the icon (could be a negative value).

Allowed values: >= -2147483647

Default value: 0


The "icon-spacing" style property

  "icon-spacing"             gint                  : Read

Additional distance between the icon and the child widget.

Allowed values: >= 0

Default value: 5