gtk+ r20486 - trunk/gtk
- From: timj svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r20486 - trunk/gtk
- Date: Fri, 20 Jun 2008 10:57:35 +0000 (UTC)
Author: timj
Date: Fri Jun 20 10:57:35 2008
New Revision: 20486
URL: http://svn.gnome.org/viewvc/gtk+?rev=20486&view=rev
Log:
Add accessors for GtkDialog public vars, also implement GtkContainer::add/remove
Modified:
trunk/gtk/gtkdialog.c
trunk/gtk/gtkdialog.h
Modified: trunk/gtk/gtkdialog.c
==============================================================================
--- trunk/gtk/gtkdialog.c (original)
+++ trunk/gtk/gtkdialog.c Fri Jun 20 10:57:35 2008
@@ -77,6 +77,11 @@
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 @@
{
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 @@
}
}
+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 @@
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"
Modified: trunk/gtk/gtkdialog.h
==============================================================================
--- trunk/gtk/gtkdialog.h (original)
+++ trunk/gtk/gtkdialog.h Fri Jun 20 10:57:35 2008
@@ -34,6 +34,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
+#include <gtk/gtkhbbox.h>
G_BEGIN_DECLS
@@ -171,6 +172,17 @@
/* 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]