SwamiguiStatusbar

SwamiguiStatusbar

Synopsis

#define             SWAMIGUI_STATUSBAR_GLOBAL_MAXLEN
                    SwamiguiStatusbar;
gboolean            (*SwamiguiStatusbarCloseFunc)       (SwamiguiStatusbar *statusbar,
                                                         GtkWidget *widg);
enum                SwamiguiStatusbarPos;
enum                SwamiguiStatusbarTimeout;
GtkWidget *         swamigui_statusbar_new              (void);
guint               swamigui_statusbar_add              (SwamiguiStatusbar *statusbar,
                                                         const char *group,
                                                         int timeout,
                                                         guint pos,
                                                         GtkWidget *widg);
void                swamigui_statusbar_remove           (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group);
void                swamigui_statusbar_printf           (SwamiguiStatusbar *statusbar,
                                                         const char *format,
                                                         ...);
GtkWidget *         swamigui_statusbar_msg_label_new    (const char *label,
                                                         guint maxlen);
GtkWidget *         swamigui_statusbar_msg_progress_new (const char *label,
                                                         SwamiguiStatusbarCloseFunc close);
void                swamigui_statusbar_msg_set_timeout  (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         int timeout);
void                swamigui_statusbar_msg_set_label    (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         const char *label);
void                swamigui_statusbar_msg_set_progress (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         double val);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkFrame
                                       +----SwamiguiStatusbar

Implemented Interfaces

SwamiguiStatusbar implements AtkImplementorIface and GtkBuildable.

Properties

  "default-timeout"          gint                  : Read / Write

Description

Details

SWAMIGUI_STATUSBAR_GLOBAL_MAXLEN

#define SWAMIGUI_STATUSBAR_GLOBAL_MAXLEN 24

SwamiguiStatusbar

typedef struct _SwamiguiStatusbar SwamiguiStatusbar;

SwamiguiStatusbarCloseFunc ()

gboolean            (*SwamiguiStatusbarCloseFunc)       (SwamiguiStatusbar *statusbar,
                                                         GtkWidget *widg);

Callback function prototype which gets called when a close button on a progress status bar item gets activated.

statusbar :

The status bar widget

widg :

The message widget

Returns :

Should return TRUE to remove the item from the status bar, FALSE to keep it (useful if a confirmation dialog is popped for the user, etc).

enum SwamiguiStatusbarPos

typedef enum
{
  SWAMIGUI_STATUSBAR_POS_LEFT,
  SWAMIGUI_STATUSBAR_POS_RIGHT
} SwamiguiStatusbarPos;

enum SwamiguiStatusbarTimeout

typedef enum
{
  SWAMIGUI_STATUSBAR_TIMEOUT_DEFAULT = -1,  /* uses "default-timeout" property */
  SWAMIGUI_STATUSBAR_TIMEOUT_FOREVER = 0    /* don't timeout */
} SwamiguiStatusbarTimeout;

swamigui_statusbar_new ()

GtkWidget *         swamigui_statusbar_new              (void);

Create a new status bar widget.

Returns :

New widget.

swamigui_statusbar_add ()

guint               swamigui_statusbar_add              (SwamiguiStatusbar *statusbar,
                                                         const char *group,
                                                         int timeout,
                                                         guint pos,
                                                         GtkWidget *widg);

Add a widget to a status bar. The widg is usually created with one of the helper functions, such as swamigui_statusbar_msg_label_new() or swamigui_statusbar_msg_progress_new(), although an arbitrary widget can be added.

statusbar :

Statusbar widget

group :

Group identifier (existing message with same group is replaced, NULL for no group)

timeout :

Timeout of statusbar message in milliseconds (see SwamiguiStatusbarTimeout for special values including SWAMIGUI_STATUSBAR_TIMEOUT_FOREVER (0) for no timeout and SWAMIGUI_STATUSBAR_TIMEOUT_DEFAULT to use "default-timeout" property value)

pos :

Position of message (SwamiguiStatusbarPos, 0 for default - left)

widg :

Status widget to add to status bar

Returns :

New message unique ID (which can be used to change/remove message)

swamigui_statusbar_remove ()

void                swamigui_statusbar_remove           (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group);

Remove a message by id or group.

statusbar :

Statusbar widget

id :

Unique ID of message (0 if group is specified)

group :

Group of message to remove (NULL if id is specified)

swamigui_statusbar_printf ()

void                swamigui_statusbar_printf           (SwamiguiStatusbar *statusbar,
                                                         const char *format,
                                                         ...);

A convenience function to display a message label to a statusbar with the "default-timeout" property value for the timeout, no group and positioned left. This is commonly used to display an operation that was performed.

statusbar :

Statusbar widget

format :

printf() style format string.

... :

Additional arguments for format string

swamigui_statusbar_msg_label_new ()

GtkWidget *         swamigui_statusbar_msg_label_new    (const char *label,
                                                         guint maxlen);

A helper function to create a label widget for use in a statusbar. Doesn't do a whole lot beyond just creating a regular GtkLabel and setting its max length.

label :

Label text to assign to new widget

maxlen :

Maximum length of label widget (sets size, 0 to set to width of label)

swamigui_statusbar_msg_progress_new ()

GtkWidget *         swamigui_statusbar_msg_progress_new (const char *label,
                                                         SwamiguiStatusbarCloseFunc close);

A helper function to create a progress status bar item.

label :

Label text to assign to new widget

close :

Close callback function (NULL to not have a close button)

swamigui_statusbar_msg_set_timeout ()

void                swamigui_statusbar_msg_set_timeout  (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         int timeout);

Modify the timeout of an existing message in the statusbar. Message is selected by id or group.

statusbar :

Statusbar widget

id :

Unique ID of message (0 if group is specified)

group :

Group of message (NULL if id is specified)

timeout :

New timeout of message in milliseconds (see SwamiguiStatusbarTimeout for special values including SWAMIGUI_STATUSBAR_TIMEOUT_FOREVER (0) for no timeout and SWAMIGUI_STATUSBAR_TIMEOUT_DEFAULT to use "default-timeout" property value)

swamigui_statusbar_msg_set_label ()

void                swamigui_statusbar_msg_set_label    (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         const char *label);

Modify the label of an existing message in the statusbar. Message is selected by id or group. This function should only be used for GtkLabel widget status items or those created with swamigui_statusbar_msg_label_new() and swamigui_statusbar_msg_progress_new().

statusbar :

Statusbar widget

id :

Unique ID of message (0 if group is specified)

group :

Group of message (NULL if id is specified)

label :

New label text to assign to statusbar item

swamigui_statusbar_msg_set_progress ()

void                swamigui_statusbar_msg_set_progress (SwamiguiStatusbar *statusbar,
                                                         guint id,
                                                         const char *group,
                                                         double val);

Modify the progress indicator of an existing message in the statusbar. Message is selected by id or group. This function should only be used for widget status items created with swamigui_statusbar_msg_progress_new().

statusbar :

Statusbar widget

id :

Unique ID of message (0 if group is specified)

group :

Group of message (NULL if id is specified)

val :

New progress value (0.0 to 1.0)

Property Details

The "default-timeout" property

  "default-timeout"          gint                  : Read / Write

Default timeout in milliseconds.

Allowed values: >= 0

Default value: 4000