gtk.ColorSelection — a widget used to select a color.
class gtk.ColorSelection(gtk.VBox): |
Functionsdef gtk.color_selection_palette_from_string(
str
)def gtk.color_selection_palette_to_string(
colors
)
+--gobject.GObject +--gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Box +-- gtk.VBox +-- gtk.ColorSelection
|
gtk.Container Signal Prototypes
def callback( |
The gtk.ColorSelection
is a widget that is used to select a color. It consists of a color wheel and
entry boxes for color parameters such as hue, saturation, value, red, green,
blue, and color name and optionally an opacity control and/or a color
palette. It is found on the standard color selection dialog box gtk.ColorSelectionDialog
.
The color wheel can be manipulated to set a new color or new entries can be
made in the entry boxes. The new color is displayed next to the previous
color. An eyedropper button is available to allow the selection of a color
from a pixel location on the display.
gtk.ColorSelection()
Returns : | a new gtk.ColorSelection |
Creates a new gtk.ColorSelection
widget.
def get_has_opacity_control()
Returns : | True if the
colorsel has an opacity control;
False if it doesn't. |
The get_opacity
() method determines
whether the colorselection is displaying an opacity control.
def set_has_opacity_control(has_opacity
)
| If True the colorselection
will display the opacity control. |
The set_has_opacity_control
() method
sets the "has-opacity-control" property to the value of
has_opacity
. If has_opacity
is
True
the colorselection will display the opacity control
slider and entry box; otherwise the opacity control is not displayed.
def get_has_palette()
Returns : | True if the selector has a
palette; False if it hasn't. |
The get_has_palette
() method returns
the value of the "has-palette" property that determines whether the color
selector displays a color palette.
def set_has_palette(has_palette
)
| If True the color palette is
displayed. |
The set_has_palette
() method sets the
"has-palette" property to the value of has_palette
.
If has_palette
is True the palette will be displayed;
otherwise the palette will be hidden.
def set_current_color(color
)
| A gtk.gdk.Color to set
the current color with. |
The set_current_color
() method sets the
current color to the value of color
. The first time
this is called, it will also set the previous color to the value of
color
too.
def set_current_alpha(alpha
)
| an integer between 0 and 65535. |
The set_current_alpha
() method sets the
"current-alpha" property (the opacity) to the value of alpha. The alpha
(opacity) is displayed in the range of 0 to 255 in the colorselection. The
first time this is called, it will also set the previous opacity to the
value of alpha
too.
def get_current_color()
Returns : | a gtk.gdk.Color
representing the current color. |
The get_current_color
() method
retrieves the current color in the colorselection.
def get_current_alpha()
Returns : | the current alpha value in the range 0 to 65535. |
The get_current_alpha
() method returns
the value of the "current_alpha" property that controls the opacity
value.
def set_previous_color(color
)
| a gtk.gdk.Color to set
the previous color with. |
The set_previous_color
() method sets
the 'previous' color to the value of color
.
Applications usually do not call this method. The first time set_current_color
()
the 'previous' color will be set.
def set_previous_alpha(alpha
)
| an integer between 0 and 65535. |
The set_previous_alpha() method sets the 'previous' alpha to the
value of alpha
. Applications usually do not call this
method. The first time set_current_alpha
()
the 'previous' alpha will be set.
def get_previous_color()
Returns : | a gtk.gdk.Color with
the previous color value. |
The get_previous_color
() method
retrieves the previous color value.
def gtk.color_selection_palette_from_string(str
)
| the string containing the list of colors |
Returns : | a list of gtk.gdk.Color objects
or None if the conversion fails |
The
gtk.color_selection_palette_from_string
() function
returns a list of gtk.gdk.Color
objects
corresponding to the color specifications in the string specified by
str
. str is a colon-separated list of color names
readable by gtk.gtk.color_parse
().
If str
cannot be converted to a list of color this
function returns None
.
def gtk.color_selection_palette_to_string(colors
)
| a list or tuple of gtk.gdk.Color
objects |
Returns : | a string containing a colon-separated list of
colors |
The gtk.color_selection_palette_to_string
()
function returns a string containing a colon-separated list of the
representation of the gtk.gdk.Color
objects
in colors
.
This function is useful to save a special palette of colors for
a gtk.ColorSelection
as a string that can later be used by calling the gobject.set_property
()gtk.Settings
returned from the gtk.settings_get_default
())
function.
def callback(colorselection
, user_param1
, ...
)
| the colorselection that received the signal |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "color-changed" signal is emitted when the current color in the colorselection changes.