diff options
author | Tim Janik <timj@src.gnome.org> | 2008-06-20 10:57:35 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2008-06-20 10:57:35 +0000 |
commit | b15ca51c356d78b0d838b4fa8dfb9b7256dc8369 (patch) | |
tree | b6632fee744ecb567922eab447856d8b79c2e624 /gtk | |
parent | 112f03938c0d56f9edd38c001e624d672f9ca4ab (diff) | |
download | gtk+-b15ca51c356d78b0d838b4fa8dfb9b7256dc8369.tar.gz |
Add accessors for GtkDialog public vars, also implement GtkContainer::add/remove
svn path=/trunk/; revision=20486
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkdialog.c | 68 | ||||
-rw-r--r-- | gtk/gtkdialog.h | 12 |
2 files changed, 80 insertions, 0 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 934d2db49e..8928d1253d 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -77,6 +77,11 @@ static void gtk_dialog_map (GtkWidget *widget); static void gtk_dialog_close (GtkDialog *dialog); +static void gtk_dialog_add (GtkContainer *container, + GtkWidget *widget); +static void gtk_dialog_remove (GtkContainer *container, + GtkWidget *widget); + static ResponseData* get_response_data (GtkWidget *widget, gboolean create); static void gtk_dialog_buildable_interface_init (GtkBuildableIface *iface); @@ -118,13 +123,18 @@ gtk_dialog_class_init (GtkDialogClass *class) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; + GtkContainerClass *container_class; GtkBindingSet *binding_set; gobject_class = G_OBJECT_CLASS (class); widget_class = GTK_WIDGET_CLASS (class); + container_class = GTK_CONTAINER_CLASS (class); gobject_class->set_property = gtk_dialog_set_property; gobject_class->get_property = gtk_dialog_get_property; + + container_class->add = gtk_dialog_add; + container_class->remove = gtk_dialog_remove; widget_class->map = gtk_dialog_map; widget_class->style_set = gtk_dialog_style_set; @@ -350,6 +360,28 @@ gtk_dialog_get_property (GObject *object, } } +static void +gtk_dialog_add (GtkContainer *container, + GtkWidget *widget) +{ + GtkDialog *dialog; + + dialog = GTK_DIALOG (container); + + gtk_box_pack_start (GTK_BOX (dialog->vbox), widget, FALSE, FALSE, 0); +} + +static void +gtk_dialog_remove (GtkContainer *container, + GtkWidget *widget) +{ + GtkDialog *dialog; + + dialog = GTK_DIALOG (container); + + gtk_container_remove (GTK_CONTAINER (dialog->vbox), widget); +} + static gint gtk_dialog_delete_event_handler (GtkWidget *widget, GdkEventAny *event, @@ -1445,5 +1477,41 @@ gtk_dialog_buildable_custom_finished (GtkBuildable *buildable, g_slice_free (ActionWidgetsSubParserData, parser_data); } +GtkHButtonBox * +gtk_dialog_get_action_area (GtkDialog *dialog) +{ + g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL); + + return dialog->action_area; +} + +void +gtk_dialog_pack_start (GtkDialog *dialog, + GtkWidget *widget, + gboolean expand, + gboolean fill, + guint padding) +{ + g_return_if_fail (GTK_IS_DIALOG (dialog)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + gtk_box_pack_start (GTK_BOX (dialog->vbox), + widget, expand, fill, padding); +} + +void +gtk_dialog_pack_end (GtkDialog *dialog, + GtkWidget *widget, + gboolean expand, + gboolean fill, + guint padding) +{ + g_return_if_fail (GTK_IS_DIALOG (dialog)); + g_return_if_fail (GTK_IS_WIDGET (widget)); + + gtk_box_pack_end (GTK_BOX (dialog->vbox), + widget, expand, fill, padding); +} + #define __GTK_DIALOG_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h index 24252bb5a8..e8b4d79ebd 100644 --- a/gtk/gtkdialog.h +++ b/gtk/gtkdialog.h @@ -34,6 +34,7 @@ #include <gdk/gdk.h> #include <gtk/gtkwindow.h> +#include <gtk/gtkhbbox.h> G_BEGIN_DECLS @@ -171,6 +172,17 @@ void gtk_dialog_response (GtkDialog *dialog, /* Returns response_id */ gint gtk_dialog_run (GtkDialog *dialog); +GtkHButtonBox* gtk_dialog_get_action_area (GtkDialog *dialog); +void gtk_dialog_pack_start (GtkDialog *dialog, + GtkWidget *widget, + gboolean expand, + gboolean fill, + guint padding); +void gtk_dialog_pack_end (GtkDialog *dialog, + GtkWidget *widget, + gboolean expand, + gboolean fill, + guint padding); /* For private use only */ void _gtk_dialog_set_ignore_separator (GtkDialog *dialog, |