Remove container implementation, which isn't thought for handling
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
This commit is contained in:

committed by
Carlos Garnacho

parent
a13f698b3a
commit
60e1b3ea89
14
ChangeLog
14
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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*
|
||||
* Returns: the content area #GtkVBox.
|
||||
*
|
||||
* Since: 2.14
|
||||
**/
|
||||
void
|
||||
gtk_dialog_pack_start (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_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.
|
||||
*
|
||||
* Since: 2.14
|
||||
**/
|
||||
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);
|
||||
return dialog->vbox;
|
||||
}
|
||||
|
||||
#define __GTK_DIALOG_C__
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user