#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
{
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,
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));
}
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);
_("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)
{