#include <gdk/gdk.h>
#include <gtk/gtk.h>
Go to the source code of this file.
Defines | |
#define | GTK_TYPE_PERIODIC (gtk_periodic_get_type ()) |
#define | GTK_PERIODIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PERIODIC, GtkPeriodic)) |
#define | GTK_PERIODIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PERIODIC, GtkPeriodicClass)) |
#define | GTK_IS_PERIODIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PERIODIC)) |
#define | GTK_IS_PERIODIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PERIODIC)) |
#define | GTK_PERIODIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PERIODIC, GtkPeriodicClass)) |
Typedefs | |
typedef struct _GtkPeriodic | GtkPeriodic |
typedef struct _GtkPeriodicClass | GtkPeriodicClass |
typedef void(* | GtkPeriodicColorFunc )(int, GdkColor *, gpointer) |
Enumerations | |
enum | GtkPeriodicColorSchemes |
Functions | |
GType | gtk_periodic_get_type (void) G_GNUC_CONST |
GtkWidget * | gtk_periodic_new (void) |
guint | gtk_periodic_get_element (GtkPeriodic *periodic) |
void | gtk_periodic_set_element (GtkPeriodic *periodic, guint element) |
int | gtk_periodic_add_color_scheme (GtkPeriodic *periodic, GtkPeriodicColorFunc func, GtkWidget *extra_widget, gpointer user_data) |
void | gtk_periodic_set_colors (GtkPeriodic *periodic) |
Declaration of the GtkPeriodic widget.
Definition in file gtkperiodic.h.
#define GTK_IS_PERIODIC | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PERIODIC)) |
Definition at line 66 of file gtkperiodic.h.
#define GTK_IS_PERIODIC_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PERIODIC)) |
Definition at line 70 of file gtkperiodic.h.
#define GTK_PERIODIC | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PERIODIC, GtkPeriodic)) |
Casts obj to a GtkPeriodic * pointer.
Definition at line 57 of file gtkperiodic.h.
Referenced by main().
#define GTK_PERIODIC_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PERIODIC, GtkPeriodicClass)) |
Casts klass to a GtkPeriodicClass * pointer.
Definition at line 62 of file gtkperiodic.h.
#define GTK_PERIODIC_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PERIODIC, GtkPeriodicClass)) |
Definition at line 75 of file gtkperiodic.h.
#define GTK_TYPE_PERIODIC (gtk_periodic_get_type ()) |
Definition at line 51 of file gtkperiodic.h.
typedef struct _GtkPeriodic GtkPeriodic |
The GtkPeriodic widget.
Definition at line 78 of file gtkperiodic.h.
typedef struct _GtkPeriodicClass GtkPeriodicClass |
The GtkPeriodic widget object class.
Definition at line 80 of file gtkperiodic.h.
typedef void(* GtkPeriodicColorFunc)(int, GdkColor *, gpointer) |
The callback used for color schemes. It takes three arguments:
Definition at line 124 of file gtkperiodic.h.
Predefined coloring scheme used for the buttons when displaying the periodic table of the GtkPeriodic widget. Possible values are:
Definition at line 43 of file gtkperiodic.h.
int gtk_periodic_add_color_scheme | ( | GtkPeriodic * | periodic, | |
GtkPeriodicColorFunc | func, | |||
GtkWidget * | extra_widget, | |||
gpointer | user_data | |||
) |
periodic | a GtkPeriodic widget. | |
func | the callback used to get the color for an element in the new color scheme. | |
extra_widget | a widget to be added as a child of periodic. | |
user_data | data to be passed to the func callback. |
Using this function and the appropriate callback, the color used for the elements buttons can be changed to depend on any property of the elements.
guint gtk_periodic_get_element | ( | GtkPeriodic * | periodic | ) |
gtk_periodic_get_element:
periodic | a GtkPeriodic widget |
Description: used to get the currently selected element in the periodic table.
Returns: the atomic number of the currently selected element or 0 if none is selected.
GType gtk_periodic_get_type | ( | void | ) |
GtkWidget* gtk_periodic_new | ( | void | ) |
Referenced by main().
void gtk_periodic_set_colors | ( | GtkPeriodic * | periodic | ) |
periodic | a GtkPeriodic widget. |
Forces the update of the current color scheme. This is useful when the color scheme depends upon a parameter which has changed.
void gtk_periodic_set_element | ( | GtkPeriodic * | periodic, | |
guint | element | |||
) |
gtk_periodic_set_element:
periodic | a GtkPeriodic widget | |
element | the atomic number of the element to select or 0 |
Description: sets the selected element in the periodic table.