]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcolorseldialog.c
treeview: Add _gtk_rbtree_node_get_index()
[~andy/gtk] / gtk / gtkcolorseldialog.c
index 7a729ec97f62576e54d070099266a3af87de7573..a8a77e7177adbb8be27f188802d4c3b9f5632c97 100644 (file)
 #include <glib.h>
 #include "gtkcolorseldialog.h"
 #include "gtkframe.h"
-#include "gtkhbbox.h"
 #include "gtkbutton.h"
 #include "gtkstock.h"
 #include "gtkintl.h"
 #include "gtkbuildable.h"
 
 
+/**
+ * SECTION:gtkcolorseldlg
+ * @Short_description: A standard dialog box for selecting a color
+ * @Title: GtkColorSelectionDialog
+ *
+ * The #GtkColorSelectionDialog provides a standard dialog which
+ * allows the user to select a color much like the #GtkFileSelection
+ * provides a standard dialog for file selection.
+ *
+ * Use gtk_color_selection_dialog_get_color_selection() to get the
+ * #GtkColorSelection widget contained within the dialog. Use this widget
+ * and its gtk_color_selection_get_current_color()
+ * function to gain access to the selected color.  Connect a handler
+ * for this widget's #GtkColorSelection::color-changed signal to be notified
+ * when the color changes.
+ *
+ * <refsect2 id="GtkColorSelectionDialog-BUILDER-UI">
+ * <title>GtkColorSelectionDialog as GtkBuildable</title>
+ * The GtkColorSelectionDialog implementation of the GtkBuildable interface
+ * exposes the embedded #GtkColorSelection as internal child with the
+ * name "color_selection". It also exposes the buttons with the names
+ * "ok_button", "cancel_button" and "help_button".
+ * </refsect2>
+ */
+
 
 struct _GtkColorSelectionDialogPrivate
 {
@@ -102,6 +126,8 @@ static void
 gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
 {
   GObjectClass   *gobject_class = G_OBJECT_CLASS (klass);
+  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
   gobject_class->get_property = gtk_color_selection_dialog_get_property;
 
   g_object_class_install_property (gobject_class,
@@ -133,6 +159,8 @@ gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
                                                     GTK_TYPE_WIDGET,
                                                     G_PARAM_READABLE));
 
+  gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_COLOR_CHOOSER);
+
   g_type_class_add_private (klass, sizeof (GtkColorSelectionDialogPrivate));
 }
 
@@ -162,17 +190,17 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
   gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION (priv->colorsel), FALSE);
   gtk_container_add (GTK_CONTAINER (content_area), priv->colorsel);
   gtk_widget_show (priv->colorsel);
-  
+
   priv->cancel_button = gtk_dialog_add_button (dialog,
                                                GTK_STOCK_CANCEL,
                                                GTK_RESPONSE_CANCEL);
 
   priv->ok_button = gtk_dialog_add_button (dialog,
-                                           GTK_STOCK_OK,
+                                           _("_Select"),
                                            GTK_RESPONSE_OK);
-                                                   
+
   gtk_widget_grab_default (priv->ok_button);
-  
+
   priv->help_button = gtk_dialog_add_button (dialog,
                                              GTK_STOCK_HELP,
                                              GTK_RESPONSE_HELP);
@@ -189,6 +217,14 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
                         _("Color Selection"));
 }
 
+/**
+ * gtk_color_selection_dialog_new:
+ * @title: a string containing the title text for the dialog.
+ *
+ * Creates a new #GtkColorSelectionDialog.
+ *
+ * Returns: a #GtkColorSelectionDialog.
+ */
 GtkWidget*
 gtk_color_selection_dialog_new (const gchar *title)
 {