]> Pileus Git - ~andy/gtk/commitdiff
Remove container implementation, which isn't thought for handling
authorCarlos Garnacho <carlos@imendio.com>
Tue, 24 Jun 2008 10:22:40 +0000 (10:22 +0000)
committerCarlos Garnacho <carlosg@src.gnome.org>
Tue, 24 Jun 2008 10:22:40 +0000 (10:22 +0000)
2008-06-24  Carlos Garnacho  <carlos@imendio.com>

        * gtk/gtkdialog.[ch]: Remove container implementation, which isn't
        thought for handling non-direct children. Fixes #539732.
        (gtk_dialog_pack_start) (gtk_dialog_pack_end): Removed as well, it
        doesn't provide enough control to API users (removing, reordering...),
        this is better handled through:
        (gtk_dialog_get_content_area): New function which just returns
        dialog->vbox.
        * gtk/gtk.symbols: Modify accordingly.
        * docs/reference/gtk/tmpl/gtkdialog.sgml: Update docs to recommend
        using gtk_dialog_get_[action|content]_area() instead of accessing
        dialog struct members directly.

svn path=/trunk/; revision=20680

ChangeLog
docs/reference/gtk/tmpl/gtkdialog.sgml
gtk/gtk.symbols
gtk/gtkdialog.c
gtk/gtkdialog.h

index bf4e03357d644d3f038399bc2f3382072704882f..9d5d759ec1bb5caa2d8396e3d8a3d4753ea5a32d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-06-24  Carlos Garnacho  <carlos@imendio.com>
+
+       * gtk/gtkdialog.[ch]: Remove container implementation, which isn't
+       thought for handling non-direct children. Fixes #539732.
+       (gtk_dialog_pack_start) (gtk_dialog_pack_end): Removed as well, it
+       doesn't provide enough control to API users (removing, reordering...),
+       this is better handled through:
+       (gtk_dialog_get_content_area): New function which just returns
+       dialog->vbox.
+       * gtk/gtk.symbols: Modify accordingly.
+       * docs/reference/gtk/tmpl/gtkdialog.sgml: Update docs to recommend
+       using gtk_dialog_get_[action|content]_area() instead of accessing
+       dialog struct members directly.
+
 2008-06-24  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtkassistant.h
index b6efb0c79286193d45374967dcc5f67ee8400cc5..1cbb8367206237c723b996293072c4ac42607e5f 100644 (file)
@@ -30,9 +30,8 @@ buttons.
 
 <para>
 If 'dialog' is a newly created dialog, the two primary areas of the window 
-can be accessed as <literal>GTK_DIALOG(dialog)->vbox</literal> and 
-<literal>GTK_DIALOG(dialog)->action_area</literal>,
-as can be seen from the example, below.
+can be accessed through gtk_dialog_get_content_area() and
+gtk_dialog_get_action_area(), as can be seen from the example, below.
 </para>
 
 <para>
@@ -74,7 +73,7 @@ dialog contents manually if you had more than a simple message in the dialog.
 
 void quick_message (gchar *message) {
 
-   GtkWidget *dialog, *label;
+   GtkWidget *dialog, *label, *content_area;
    
    /* Create the widgets */
    
@@ -84,6 +83,7 @@ void quick_message (gchar *message) {
                                          GTK_STOCK_OK,
                                          GTK_RESPONSE_NONE,
                                          NULL);
+   content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
    label = gtk_label_new (message);
    
    /* Ensure that the dialog box is destroyed when the user responds. */
@@ -95,8 +95,7 @@ void quick_message (gchar *message) {
 
    /* Add the label, and show everything we've added to the dialog. */
 
-   gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
-                      label);
+   gtk_container_add (GTK_CONTAINER (content_area), label);
    gtk_widget_show_all (dialog);
 }
 
index 5ed7d203db345a41272a476e10625ca68157a8e8..a83d1f8fe6500c2345483ed06d7713590d656a7f 100644 (file)
@@ -1045,13 +1045,12 @@ gtk_dialog_add_action_widget
 gtk_dialog_add_button
 gtk_dialog_add_buttons G_GNUC_NULL_TERMINATED
 gtk_dialog_get_action_area
+gtk_dialog_get_content_area
 gtk_dialog_get_has_separator
 gtk_dialog_get_response_for_widget
 gtk_dialog_get_type G_GNUC_CONST
 gtk_dialog_new
 gtk_dialog_new_with_buttons
-gtk_dialog_pack_end
-gtk_dialog_pack_start
 gtk_dialog_response
 gtk_dialog_run
 gtk_alternative_dialog_button_order
index 969026458bbbb693cf39ddf5ba7f862ee38fb772..45471fad409d8da1b286dec7669f739387bc313b 100644 (file)
@@ -77,11 +77,6 @@ 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);
@@ -123,18 +118,13 @@ 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;
@@ -362,28 +352,6 @@ 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,
@@ -1498,57 +1466,21 @@ gtk_dialog_get_action_area (GtkDialog *dialog)
 }
 
 /**
- * gtk_dialog_pack_start:
+ * gtk_dialog_get_content_area:
  * @dialog: a #GtkDialog
- * @widget: #GtkWidget to be added to @dialog.
- * @expand: %TRUE if @widget should take all extra space.
- * @fill: %TRUE if all space given should be used by @widget
- * @padding: extra pixels to put between @widget and its neighbors
  *
- * This function similar to gtk_box_pack_start() packs @widget
- * with reference to the start of @dialog.
+ * Returns the content area of @dialog.
  *
- * Since: 2.14
- **/
-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);
-}
-
-/**
- * gtk_dialog_pack_end:
- * @dialog: a #GtkDialog
- * @widget: #GtkWidget to be added to @dialog.
- * @expand: %TRUE if @widget should take all extra space.
- * @fill: %TRUE if all space given should be used by @widget
- * @padding: extra pixels to put between @widget and its neighbors
- *
- * This function similar to gtk_box_pack_end() packs @widget
- * with reference to the end of @dialog.
+ * Returns: the content area #GtkVBox.
  *
  * Since: 2.14
  **/
-void
-gtk_dialog_pack_end (GtkDialog *dialog,
-                    GtkWidget *widget,
-                    gboolean   expand,
-                    gboolean   fill,
-                    guint      padding)
+GtkWidget *
+gtk_dialog_get_content_area (GtkDialog *dialog)
 {
-  g_return_if_fail (GTK_IS_DIALOG (dialog));
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
 
-  gtk_box_pack_end (GTK_BOX (dialog->vbox),
-                   widget, expand, fill, padding);
+  return dialog->vbox;
 }
 
 #define __GTK_DIALOG_C__
index f25311ecfe7765a27fa775fbe30595d36d176741..5cc1841b87fc8990c1694feeb1bee21defd6d4c4 100644 (file)
@@ -171,17 +171,8 @@ void gtk_dialog_response           (GtkDialog *dialog,
 /* Returns response_id */
 gint gtk_dialog_run                (GtkDialog *dialog);
 
-GtkWidget * 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);
+GtkWidget * gtk_dialog_get_action_area  (GtkDialog *dialog);
+GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);
 
 /* For private use only */
 void _gtk_dialog_set_ignore_separator (GtkDialog *dialog,