gtk_shadeComboBoxWidget

gtk_shadeComboBoxWidget — Defines a specialised GtkComboBox to choose pre-built shades.

Synopsis

#include <coreTools/toolShade.h>

                    VisuUiShadeCombobox;
                    VisuUiShadeComboboxClass;
GdkPixbuf *         visu_ui_shade_combobox_buildStamp   (ToolShade *shade,
                                                         GdkPixbuf *pixbuf);
ToolShade *         visu_ui_shade_combobox_getSelection (VisuUiShadeCombobox *shadeComboBox);
GdkPixbuf *         visu_ui_shade_combobox_getStamp     (VisuUiShadeCombobox *shadeComboBox,
                                                         ToolShade *shade);
GtkWidget *         visu_ui_shade_combobox_new          (gboolean hasAlphaChannel,
                                                         gboolean showNames);
gboolean            visu_ui_shade_combobox_setSelectionByShade
                                                        (VisuUiShadeCombobox *shadeComboBox,
                                                         ToolShade *shade);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkBin
                           +----GtkComboBox
                                 +----VisuUiShadeCombobox

Implemented Interfaces

VisuUiShadeCombobox implements AtkImplementorIface, GtkBuildable, GtkCellLayout and GtkCellEditable.

Signals

  "shade-selected"                                 : Action

Description

This widget looks like a GtkComboBox and it displays a list of preset colour shades. These patterns are defined by colour parameters, see ToolShade.

This widget can emit a "shade-selected" signal that is a wrapper around the "changed" signal, but it is emitted only when a new shade is selected and this shade is passed to the callback.

Details

VisuUiShadeCombobox

typedef struct _VisuUiShadeCombobox VisuUiShadeCombobox;

Private structure to store informations of a VisuUiShadeCombobox object.

Since 3.3


VisuUiShadeComboboxClass

typedef struct _VisuUiShadeComboboxClass VisuUiShadeComboboxClass;

Private structure to store informations of a VisuUiShadeComboboxClass object.

Since 3.3


visu_ui_shade_combobox_buildStamp ()

GdkPixbuf *         visu_ui_shade_combobox_buildStamp   (ToolShade *shade,
                                                         GdkPixbuf *pixbuf);

This method is used to create pixbuf representing shades. If pixbuf is given, it must be a valid pixbuf, and the shade is created in it. Otherwise, a new pixbuf is created.

shade :

a ToolShade object ;

pixbuf :

an existing pixbuf (can be NULL). [inout][allow-none]

Returns :

a pixbuf pointer. [transfer full]

Since 3.3


visu_ui_shade_combobox_getSelection ()

ToolShade *         visu_ui_shade_combobox_getSelection (VisuUiShadeCombobox *shadeComboBox);

The user can access to the selected ToolShade object using this method.

shadeComboBox :

a VisuUiShadeCombobox widget.

Returns :

a pointer to the selected ToolShade object (or NULL). This object is read-only. [transfer none]

Since 3.3


visu_ui_shade_combobox_getStamp ()

GdkPixbuf *         visu_ui_shade_combobox_getStamp     (VisuUiShadeCombobox *shadeComboBox,
                                                         ToolShade *shade);

The shadeComboBox has little pixbufs to represent the shade. User methods can use these pixbufs but should considered them read-only.

shadeComboBox :

a VisuUiShadeCombobox widget ;

shade :

a ToolShade object.

Returns :

a pixbuf pointer corresponding to the little image shown on the shadeComboBox. [transfer none]

Since 3.3


visu_ui_shade_combobox_new ()

GtkWidget *         visu_ui_shade_combobox_new          (gboolean hasAlphaChannel,
                                                         gboolean showNames);

A VisuUiShadeCombobox widget is like a GtkComboBox widget, but it is already filled with the known shades. Using this widget is a convienient way to share shades between all part of V_Sim and to give a consistent look of all shade selection. If the argument hasAlphaChannel is FALSE, the widget display all shades but without their alpha channel, assuming it to be fully opaque.

hasAlphaChannel :

a boolean.

showNames :

if TRUE, the names of the shades are displayed.

Returns :

a newly created VisuUiShadeCombobox widget. [transfer full]

Since 3.3


visu_ui_shade_combobox_setSelectionByShade ()

gboolean            visu_ui_shade_combobox_setSelectionByShade
                                                        (VisuUiShadeCombobox *shadeComboBox,
                                                         ToolShade *shade);

Use this method to set the ComboBox on the given shade. This emits a 'shade-channel' signal if the shade is changed, which means, a previous shade has been modified, or a new shade is selected.

shadeComboBox :

a VisuUiShadeCombobox widget ;

shade :

a ToolShade object.

Returns :

TRUE if the shade already exists in the model.

Since 3.3

Signal Details

The "shade-selected" signal

void                user_function                      (VisuUiShadeCombobox *combo,
                                                        gpointer             shade,
                                                        gpointer             user_data)      : Action

This signal is emitted when a new valid colour shade is selected.

combo :

the VisuUiShadeCombobox that emits the signal ;

shade :

the newly selected ToolShade.

user_data :

user data set when the signal handler was connected.

Since 3.3

See Also

VisuUiStippleCombobox, ToolShade