Add accessors for GtkDialog public vars, also implement GtkContainer::add/remove

svn path=/trunk/; revision=20486
This commit is contained in:
Tim Janik 2008-06-20 10:57:35 +00:00
parent 112f03938c
commit b15ca51c35
2 changed files with 80 additions and 0 deletions

View File

@ -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"

View File

@ -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,