# gtkperiodic.h File Reference

`#include <gdk/gdk.h>`
`#include <gtk/gtkbin.h>`
`#include <gtk/gtkvbox.h>`
`#include <gtk/gtktogglebutton.h>`

Go to the source code of this file.

## Defines

#define | GTK_TYPE_PERIODIC (gtk_periodic_get_type ())
#define | GTK_PERIODIC(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PERIODIC, GtkPeriodic))
#define | GTK_PERIODIC_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PERIODIC, GtkPeriodicClass))
#define | GTK_IS_PERIODIC(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PERIODIC))
#define | GTK_IS_PERIODIC_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PERIODIC))
#define | GTK_PERIODIC_GET_CLASS(obj) (GTK_CHECK_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

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)

## Detailed Description

Declaration of the GtkPeriodic widget.

Definition in file gtkperiodic.h.

## Define Documentation

#define GTK_IS_PERIODIC | ( | obj |  | ) | (GTK_CHECK_TYPE ((obj), GTK_TYPE_PERIODIC))

Returns:
  TRUE if obj points to a GtkPeriodic widget, FALSE otherwise.

Definition at line 68 of file gtkperiodic.h.

#define GTK_IS_PERIODIC_CLASS | ( | klass |  | ) | (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PERIODIC))

Returns:
  TRUE if klass points to a GtkPeriodicClass, FALSE otherwise.

Definition at line 72 of file gtkperiodic.h.

#define GTK_PERIODIC | ( | obj |  | ) | (GTK_CHECK_CAST ((obj), GTK_TYPE_PERIODIC, GtkPeriodic))

Casts obj to a GtkPeriodic * pointer.

Returns:
  a pointer to the GtkPeriodic * or NULL if obj does not point to a GtkPeriodic widget.

Definition at line 59 of file gtkperiodic.h.

Referenced by main().

#define GTK_PERIODIC_CLASS | ( | klass |  | ) | (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PERIODIC, GtkPeriodicClass))

Casts klass to a GtkPeriodicClass * pointer.

Returns:
  a pointer to the GtkPeriodicClass * or NULL if obj not point to a GtkPeriodicClass.

Definition at line 64 of file gtkperiodic.h.

#define GTK_PERIODIC_GET_CLASS | ( | obj |  | ) | (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_PERIODIC, GtkPeriodicClass))

Returns:
  the GtkPeriodicClass * associated to obj if obj points to a GtkPeriodic widget, NULL otherwise.

Definition at line 77 of file gtkperiodic.h.

#define GTK_TYPE_PERIODIC (gtk_periodic_get_type ())

Returns:
  the GType associated to GtkPeriodic

Definition at line 53 of file gtkperiodic.h.

## Typedef Documentation

typedef struct _GtkPeriodic GtkPeriodic

The GtkPeriodic widget.

Definition at line 80 of file gtkperiodic.h.

typedef struct _GtkPeriodicClass GtkPeriodicClass

The GtkPeriodic widget object class.

Definition at line 82 of file gtkperiodic.h.

typedef void(* GtkPeriodicColorFunc)(int, GdkColor *, gpointer)

The callback used for color schemes. It takes three arguments:

- the atomic number Z.
- a pointer to the GdkColor structure to be filled by the callback
- a pointer to user's data.

Definition at line 126 of file gtkperiodic.h.

## Enumeration Type Documentation

enum GtkPeriodicColorSchemes

Predefined coloring scheme used for the buttons when displaying the periodic table of the GtkPeriodic widget. Possible values are:

- GTK_PERIODIC_COLOR_NONE: the default Gtk theme is used.
- GTK_PERIODIC_COLOR_DEFAULT: the default color for each element is used as returned by gcu_element_get_default_color. Other values can be added using gtk_periodic_add_color_scheme.

Definition at line 45 of file gtkperiodic.h.

## Function Documentation

int gtk_periodic_add_color_scheme | ( | GtkPeriodic * | periodic,
|  | GtkPeriodicColorFunc | func,
|  | GtkWidget * | extra_widget,
|  | gpointer | user_data |
| ) |  |  |

Parameters:

  | 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.

Returns:
  the identifier of the new color scheme.

guint gtk_periodic_get_element | ( | GtkPeriodic * | periodic | ) |

gtk_periodic_get_element:

Parameters:

  | 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.

void gtk_periodic_set_colors | ( | GtkPeriodic * | periodic | ) |

Parameters:

  | 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:

Parameters:

  | periodic | a GtkPeriodic widget
  | element | the atomic number of the element to select or 0

Description: sets the selected element in the periodic table.