GnomeProcBar

Name

GnomeProcBar -- Gnome Process Bar

Synopsis


#include <gnome.h>


struct      GnomeProcBar;
#define     GNOME_PROC_BAR__CLASS           (klass)
GtkWidget*  gnome_proc_bar_new              (GtkWidget *label,
                                             gint n,
                                             GdkColor *colors,
                                             gint (*cb) ());
void        gnome_proc_bar_set_values       (GnomeProcBar *pb,
                                             unsigned val[]);
void        gnome_proc_bar_set_orient       (GnomeProcBar *pb,
                                             gboolean vertical);
void        gnome_proc_bar_start            (GnomeProcBar *pb,
                                             gint gtime,
                                             gpointer data);
void        gnome_proc_bar_stop             (GnomeProcBar *pb);
void        gnome_proc_bar_update           (GnomeProcBar *pb,
                                             GdkColor *colors);

Object Hierarchy


  GtkObject
   +----GtkWidget
         +----GtkContainer
               +----GtkBox
                     +----GtkHBox
                           +----GnomeProcBar

Description

The GnomeProcBar widget is used to display load graphs like cpu usage, memory and swap load. It is for instance used in the cpumemusage applet and in GTop.

Details

struct GnomeProcBar

struct GnomeProcBar;


GNOME_PROC_BAR__CLASS()

#define GNOME_PROC_BAR__CLASS(klass)	GTK_CHECK_CLASS_CAST (klass, gnome_proc_bar_get_type (), GnomeProcBarClass)


gnome_proc_bar_new ()

GtkWidget*  gnome_proc_bar_new              (GtkWidget *label,
                                             gint n,
                                             GdkColor *colors,
                                             gint (*cb) ());

Creates a new Gnome Process Bar with n items with the colors of colors. To do automatic updating, you set the cb to a function which takes a single void pointer as an argument and returns TRUE or FALSE. When it returns FALSE the timer stops running and the function stops getting called. You need to call gnome_proc_bar_start with the time interval and the data argument that will be passed to the callback to actually start executing the timer.


gnome_proc_bar_set_values ()

void        gnome_proc_bar_set_values       (GnomeProcBar *pb,
                                             unsigned val[]);

Set the values of pb to val and redraw it. You will probably call this function in the callback to update the values.


gnome_proc_bar_set_orient ()

void        gnome_proc_bar_set_orient       (GnomeProcBar *pb,
                                             gboolean vertical);

Sets the orientation of pb to vertical if vertical is TRUE or to horizontal if vertical is FALSE.


gnome_proc_bar_start ()

void        gnome_proc_bar_start            (GnomeProcBar *pb,
                                             gint gtime,
                                             gpointer data);

Start a timer, and call the callback that was set on gnome_proc_bar_new with the data.


gnome_proc_bar_stop ()

void        gnome_proc_bar_stop             (GnomeProcBar *pb);

Stop running the callback in the timer.


gnome_proc_bar_update ()

void        gnome_proc_bar_update           (GnomeProcBar *pb,
                                             GdkColor *colors);

Update pb with colors. pb is not redrawn, it is only redrawn when you call gnome_proc_bar_set_values