|  |  |  | Goffice Reference Manual |  | 
|---|---|---|---|---|
void (*GOPaletteSwatchRenderCallback) (cairo_t *cr, GdkRectangle const *area, int index, gpointer data); const char* (*GOPaletteSwatchTooltipCallback) (int index, gpointer data); GOPalettePrivate; GOPalette; GtkWidget* go_palette_new (int n_swatches, double swatch_width, int n_columns, GOPaletteSwatchRenderCallback swatch_render, GOPaletteSwatchTooltipCallback get_tooltip, gpointer data, GDestroyNotify destroy); void go_palette_show_automatic (GOPalette *palette, int index, char const *label); void go_palette_show_custom (GOPalette *palette, char const *label); gpointer go_palette_get_user_data (GOPalette *palette); GtkWidget* go_palette_swatch_new (GOPalette *palette, int index); int go_palette_get_n_swatches (GOPalette *palette);
  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkMenuShell
                                 +----GtkMenu
                                       +----GOPalette
void                (*GOPaletteSwatchRenderCallback)    (cairo_t *cr,
                                                         GdkRectangle const *area,
                                                         int index,
                                                         gpointer data);
| 
 | |
| 
 | |
| 
 | |
| 
 | 
const char*         (*GOPaletteSwatchTooltipCallback)   (int index,
                                                         gpointer data);
| 
 | |
| 
 | |
| Returns : | 
GtkWidget*          go_palette_new                      (int n_swatches,
                                                         double swatch_width,
                                                         int n_columns,
                                                         GOPaletteSwatchRenderCallback swatch_render,
                                                         GOPaletteSwatchTooltipCallback get_tooltip,
                                                         gpointer data,
                                                         GDestroyNotify destroy);
| 
 | number of palette items | 
| 
 | swatch width as multiple of swatch height | 
| 
 | number of columns for displaying palette items | 
| 
 | a user function used for swatch rendering | 
| 
 | |
| 
 | user data for use by swatch render function | 
| 
 | a function to destroy user data on widget finalization | 
| Returns : | a new GOPalette object. | 
void go_palette_show_automatic (GOPalette *palette, int index, char const *label);
Adds an automatic button to palette.
| 
 | a GOPalette | 
| 
 | index to use on automatic item activation | 
| 
 | if not NULL, replace automatic button label | 
void go_palette_show_custom (GOPalette *palette, char const *label);
Adds a custom button to bottom of palette. An activation
of custom button will cause an emition of "custom_activate" signal.
| 
 | a GOPalette | 
| 
 | if not NULL, replaces custom button label | 
gpointer go_palette_get_user_data (GOPalette *palette);
| 
 | a GOPalette | 
| Returns : | a pointer to user data given to go_palette_new function. | 
GtkWidget* go_palette_swatch_new (GOPalette *palette, int index);
| 
 | a GOPalette | 
| 
 | default index | 
| Returns : | a new GtkDrawingArea which will be rendered like a paletteswatch.indexcan be changed later by changing swatch "index" data. | 
"activate" signalvoid user_function (GOPalette *gopalette, gint arg1, gpointer user_data) : Run Last
| 
 | the object which received the signal. | 
| 
 | |
| 
 | user data set when the signal handler was connected. | 
"automatic-activate" signalvoid user_function (GOPalette *gopalette, gint arg1, gpointer user_data) : Run Last
| 
 | the object which received the signal. | 
| 
 | |
| 
 | user data set when the signal handler was connected. | 
"custom-activate" signalvoid user_function (GOPalette *gopalette, gpointer user_data) : Run Last
| 
 | the object which received the signal. | 
| 
 | user data set when the signal handler was connected. |