Class: GOffice::Palette

Inherits:
Gtk::Menu
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initialize(n_swatches, swatch_width, n_columns, swatch_render, get_tooltip, data, destroy) ⇒ Gtk::Widget

Returns a new #GOPalette object.

Parameters:

  • n_swatches (Integer)

    number of palette items

  • swatch_width (Float)

    swatch width as multiple of swatch height

  • n_columns (Integer)

    number of columns for displaying palette items

  • swatch_render (GOffice::PaletteSwatchRenderCallback)

    a user function used for swatch rendering

  • get_tooltip (GOffice::PaletteSwatchTooltipCallback)

    a user function for tooltips.

  • data (GObject)

    user data for use by swatch render function

  • destroy (GLib::DestroyNotify)

    a function to destroy user data on widget finalization

Instance Method Details

#n_swatchesInteger

A convenience function.

Returns:

  • (Integer)

    the number of palette items.

#show_automatic(index, label) ⇒ nil

Adds an automatic button to palette.

Parameters:

  • index (Integer)

    index to use on automatic item activation

  • label (String)

    if not nil, replace automatic button label

Returns:

  • (nil)

#show_custom(label) ⇒ nil

Adds a custom button to bottom of palette. An activation of custom button will cause an emition of "custom_activate" signal.

Parameters:

  • label (String)

    if not nil, replaces custom button label

Returns:

  • (nil)

#swatch_new(index) ⇒ Gtk::Widget

swatch. index can be changed later by changing swatch "index" data.

Parameters:

  • index (Integer)

    default index

Returns:

  • (Gtk::Widget)

    a new Gtk::DrawingArea which will be rendered like a palette

#user_dataGObject

Returns a pointer to user data given to go_palette_new function.

Returns:

  • (GObject)

    a pointer to user data given to go_palette_new function.