ColorSelection
Object Hierarchy:
Description:
[
CCode ( type_id =
"gtk_color_selection_get_type ()" ) ]
public class ColorSelection :
Box,
Implementor,
Buildable,
Orientable
Example: ColorSelection:

public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.ColorSelection";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);
// The Box:
Gtk.Box box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
this.add (box);
// The ColorChooserWidget:
Gtk.ColorSelection widget = new Gtk.ColorSelection ();
box.add (widget);
// A Button:
Gtk.Button button = new Gtk.Button.with_label ("Print Selection");
box.add (button);
button.clicked.connect (() => {
string rgba = widget.current_rgba.to_string ();
uint alpha = widget.current_alpha;
print ("Selection\n");
print (" %s\n", rgba);
print (" %u\n", alpha);
});
}
public static int main (string[] args) {
Gtk.init (ref args);
Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}
valac --pkg gtk+-3.0 Gtk.ColorSelection.vala
Content:
Properties:
Static methods:
Creation methods:
Methods:
- public uint16 get_current_alpha ()
Returns the current alpha value.
- public void get_current_color (out Color color)
Sets color
to be the current color in the
GtkColorSelection widget.
- public RGBA get_current_rgba ()
Sets rgba
to be the current color in the
GtkColorSelection widget.
- public bool get_has_opacity_control ()
Determines whether the colorsel has an opacity control.
- public bool get_has_palette ()
Determines whether the color selector has a color palette.
- public uint16 get_previous_alpha ()
Returns the previous alpha value.
- public void get_previous_color (out Color color)
Fills color
in with the original color value.
- public RGBA get_previous_rgba ()
Fills rgba
in with the original color value.
- public bool is_adjusting ()
Gets the current state of the this.
- public void set_current_alpha (uint16 alpha)
Sets the current opacity to be alpha
.
- public void set_current_color (Color color)
Sets the current color to be color
.
- public void set_current_rgba (RGBA rgba)
Sets the current color to be rgba
.
- public void set_has_opacity_control (bool has_opacity)
Sets the this to use or not use
opacity.
- public void set_has_palette (bool has_palette)
Shows and hides the palette based upon the value of has_palette
.
- public void set_previous_alpha (uint16 alpha)
Sets the “previous” alpha to be alpha
.
- public void set_previous_color (Color color)
Sets the “previous” color to be color
.
- public void set_previous_rgba (RGBA rgba)
Sets the “previous” color to be rgba
.
Signals:
Inherited Members:
All known members inherited from class Gtk.Box
All known members inherited from class Gtk.Container
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.Orientable