1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
31 #include "gtkprivate.h"
33 #include "gtkbuildable.h"
34 #include "gtksizerequest.h"
37 #define LABEL_SIDE_PAD 2
39 struct _GtkFramePrivate
42 GtkWidget *label_widget;
49 GtkAllocation child_allocation;
50 GtkAllocation label_allocation;
62 static void gtk_frame_set_property (GObject *object,
66 static void gtk_frame_get_property (GObject *object,
70 static void gtk_frame_paint (GtkWidget *widget,
72 static gint gtk_frame_expose (GtkWidget *widget,
73 GdkEventExpose *event);
74 static void gtk_frame_size_allocate (GtkWidget *widget,
75 GtkAllocation *allocation);
76 static void gtk_frame_remove (GtkContainer *container,
78 static void gtk_frame_forall (GtkContainer *container,
79 gboolean include_internals,
81 gpointer callback_data);
83 static void gtk_frame_compute_child_allocation (GtkFrame *frame,
84 GtkAllocation *child_allocation);
85 static void gtk_frame_real_compute_child_allocation (GtkFrame *frame,
86 GtkAllocation *child_allocation);
89 static void gtk_frame_buildable_init (GtkBuildableIface *iface);
90 static void gtk_frame_buildable_add_child (GtkBuildable *buildable,
95 static void gtk_frame_size_request_init (GtkSizeRequestIface *iface);
96 static void gtk_frame_get_width (GtkSizeRequest *widget,
99 static void gtk_frame_get_height (GtkSizeRequest *widget,
102 static void gtk_frame_get_height_for_width (GtkSizeRequest *layout,
104 gint *minimum_height,
105 gint *natural_height);
106 static void gtk_frame_get_width_for_height (GtkSizeRequest *layout,
108 gint *minimum_height,
109 gint *natural_height);
112 G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN,
113 G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
114 gtk_frame_buildable_init)
115 G_IMPLEMENT_INTERFACE (GTK_TYPE_SIZE_REQUEST,
116 gtk_frame_size_request_init))
119 gtk_frame_class_init (GtkFrameClass *class)
121 GObjectClass *gobject_class;
122 GtkWidgetClass *widget_class;
123 GtkContainerClass *container_class;
125 gobject_class = (GObjectClass*) class;
126 widget_class = GTK_WIDGET_CLASS (class);
127 container_class = GTK_CONTAINER_CLASS (class);
129 gobject_class->set_property = gtk_frame_set_property;
130 gobject_class->get_property = gtk_frame_get_property;
132 g_object_class_install_property (gobject_class,
134 g_param_spec_string ("label",
136 P_("Text of the frame's label"),
139 GTK_PARAM_WRITABLE));
140 g_object_class_install_property (gobject_class,
142 g_param_spec_float ("label-xalign",
144 P_("The horizontal alignment of the label"),
148 GTK_PARAM_READWRITE));
149 g_object_class_install_property (gobject_class,
151 g_param_spec_float ("label-yalign",
153 P_("The vertical alignment of the label"),
157 GTK_PARAM_READWRITE));
158 g_object_class_install_property (gobject_class,
160 g_param_spec_enum ("shadow-type",
162 P_("Appearance of the frame border"),
163 GTK_TYPE_SHADOW_TYPE,
164 GTK_SHADOW_ETCHED_IN,
165 GTK_PARAM_READWRITE));
167 g_object_class_install_property (gobject_class,
169 g_param_spec_object ("label-widget",
171 P_("A widget to display in place of the usual frame label"),
173 GTK_PARAM_READWRITE));
175 widget_class->expose_event = gtk_frame_expose;
176 widget_class->size_allocate = gtk_frame_size_allocate;
178 container_class->remove = gtk_frame_remove;
179 container_class->forall = gtk_frame_forall;
181 class->compute_child_allocation = gtk_frame_real_compute_child_allocation;
183 g_type_class_add_private (class, sizeof (GtkFramePrivate));
187 gtk_frame_buildable_init (GtkBuildableIface *iface)
189 iface->add_child = gtk_frame_buildable_add_child;
193 gtk_frame_buildable_add_child (GtkBuildable *buildable,
198 if (type && strcmp (type, "label") == 0)
199 gtk_frame_set_label_widget (GTK_FRAME (buildable), GTK_WIDGET (child));
201 gtk_container_add (GTK_CONTAINER (buildable), GTK_WIDGET (child));
203 GTK_BUILDER_WARN_INVALID_CHILD_TYPE (GTK_FRAME (buildable), type);
207 gtk_frame_init (GtkFrame *frame)
209 GtkFramePrivate *priv;
211 frame->priv = G_TYPE_INSTANCE_GET_PRIVATE (frame,
216 priv->label_widget = NULL;
217 priv->shadow_type = GTK_SHADOW_ETCHED_IN;
218 priv->label_xalign = 0.0;
219 priv->label_yalign = 0.5;
223 gtk_frame_set_property (GObject *object,
228 GtkFrame *frame = GTK_FRAME (object);
229 GtkFramePrivate *priv = frame->priv;
234 gtk_frame_set_label (frame, g_value_get_string (value));
236 case PROP_LABEL_XALIGN:
237 gtk_frame_set_label_align (frame, g_value_get_float (value),
240 case PROP_LABEL_YALIGN:
241 gtk_frame_set_label_align (frame, priv->label_xalign,
242 g_value_get_float (value));
244 case PROP_SHADOW_TYPE:
245 gtk_frame_set_shadow_type (frame, g_value_get_enum (value));
247 case PROP_LABEL_WIDGET:
248 gtk_frame_set_label_widget (frame, g_value_get_object (value));
251 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
257 gtk_frame_get_property (GObject *object,
262 GtkFrame *frame = GTK_FRAME (object);
263 GtkFramePrivate *priv = frame->priv;
268 g_value_set_string (value, gtk_frame_get_label (frame));
270 case PROP_LABEL_XALIGN:
271 g_value_set_float (value, priv->label_xalign);
273 case PROP_LABEL_YALIGN:
274 g_value_set_float (value, priv->label_yalign);
276 case PROP_SHADOW_TYPE:
277 g_value_set_enum (value, priv->shadow_type);
279 case PROP_LABEL_WIDGET:
280 g_value_set_object (value,
282 G_OBJECT (priv->label_widget) : NULL);
285 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
292 * @label: the text to use as the label of the frame
294 * Creates a new #GtkFrame, with optional label @label.
295 * If @label is %NULL, the label is omitted.
297 * Return value: a new #GtkFrame widget
300 gtk_frame_new (const gchar *label)
302 return g_object_new (GTK_TYPE_FRAME, "label", label, NULL);
306 gtk_frame_remove (GtkContainer *container,
309 GtkFrame *frame = GTK_FRAME (container);
310 GtkFramePrivate *priv = frame->priv;
312 if (priv->label_widget == child)
313 gtk_frame_set_label_widget (frame, NULL);
315 GTK_CONTAINER_CLASS (gtk_frame_parent_class)->remove (container, child);
319 gtk_frame_forall (GtkContainer *container,
320 gboolean include_internals,
321 GtkCallback callback,
322 gpointer callback_data)
324 GtkBin *bin = GTK_BIN (container);
325 GtkFrame *frame = GTK_FRAME (container);
326 GtkFramePrivate *priv = frame->priv;
329 child = gtk_bin_get_child (bin);
331 (* callback) (child, callback_data);
333 if (priv->label_widget)
334 (* callback) (priv->label_widget, callback_data);
338 * gtk_frame_set_label:
339 * @frame: a #GtkFrame
340 * @label: (allow-none): the text to use as the label of the frame
342 * Sets the text of the label. If @label is %NULL,
343 * the current label is removed.
346 gtk_frame_set_label (GtkFrame *frame,
349 g_return_if_fail (GTK_IS_FRAME (frame));
353 gtk_frame_set_label_widget (frame, NULL);
357 GtkWidget *child = gtk_label_new (label);
358 gtk_widget_show (child);
360 gtk_frame_set_label_widget (frame, child);
365 * gtk_frame_get_label:
366 * @frame: a #GtkFrame
368 * If the frame's label widget is a #GtkLabel, returns the
369 * text in the label widget. (The frame will have a #GtkLabel
370 * for the label widget if a non-%NULL argument was passed
371 * to gtk_frame_new().)
373 * Return value: the text in the label, or %NULL if there
374 * was no label widget or the lable widget was not
375 * a #GtkLabel. This string is owned by GTK+ and
376 * must not be modified or freed.
378 G_CONST_RETURN gchar *
379 gtk_frame_get_label (GtkFrame *frame)
381 GtkFramePrivate *priv;
383 g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
387 if (GTK_IS_LABEL (priv->label_widget))
388 return gtk_label_get_text (GTK_LABEL (priv->label_widget));
394 * gtk_frame_set_label_widget:
395 * @frame: a #GtkFrame
396 * @label_widget: the new label widget
398 * Sets the label widget for the frame. This is the widget that
399 * will appear embedded in the top edge of the frame as a
403 gtk_frame_set_label_widget (GtkFrame *frame,
404 GtkWidget *label_widget)
406 GtkFramePrivate *priv;
407 gboolean need_resize = FALSE;
409 g_return_if_fail (GTK_IS_FRAME (frame));
410 g_return_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget));
411 g_return_if_fail (label_widget == NULL || gtk_widget_get_parent (label_widget) == NULL);
415 if (priv->label_widget == label_widget)
418 if (priv->label_widget)
420 need_resize = gtk_widget_get_visible (priv->label_widget);
421 gtk_widget_unparent (priv->label_widget);
424 priv->label_widget = label_widget;
428 priv->label_widget = label_widget;
429 gtk_widget_set_parent (label_widget, GTK_WIDGET (frame));
430 need_resize |= gtk_widget_get_visible (label_widget);
433 if (gtk_widget_get_visible (GTK_WIDGET (frame)) && need_resize)
434 gtk_widget_queue_resize (GTK_WIDGET (frame));
436 g_object_freeze_notify (G_OBJECT (frame));
437 g_object_notify (G_OBJECT (frame), "label-widget");
438 g_object_notify (G_OBJECT (frame), "label");
439 g_object_thaw_notify (G_OBJECT (frame));
443 * gtk_frame_get_label_widget:
444 * @frame: a #GtkFrame
446 * Retrieves the label widget for the frame. See
447 * gtk_frame_set_label_widget().
449 * Return value: (transfer none): the label widget, or %NULL if there is none.
452 gtk_frame_get_label_widget (GtkFrame *frame)
454 g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
456 return frame->priv->label_widget;
460 * gtk_frame_set_label_align:
461 * @frame: a #GtkFrame
462 * @xalign: The position of the label along the top edge
463 * of the widget. A value of 0.0 represents left alignment;
464 * 1.0 represents right alignment.
465 * @yalign: The y alignment of the label. A value of 0.0 aligns under
466 * the frame; 1.0 aligns above the frame. If the values are exactly
467 * 0.0 or 1.0 the gap in the frame won't be painted because the label
468 * will be completely above or below the frame.
470 * Sets the alignment of the frame widget's label. The
471 * default values for a newly created frame are 0.0 and 0.5.
474 gtk_frame_set_label_align (GtkFrame *frame,
478 GtkFramePrivate *priv;
480 g_return_if_fail (GTK_IS_FRAME (frame));
484 xalign = CLAMP (xalign, 0.0, 1.0);
485 yalign = CLAMP (yalign, 0.0, 1.0);
487 g_object_freeze_notify (G_OBJECT (frame));
488 if (xalign != priv->label_xalign)
490 priv->label_xalign = xalign;
491 g_object_notify (G_OBJECT (frame), "label-xalign");
494 if (yalign != priv->label_yalign)
496 priv->label_yalign = yalign;
497 g_object_notify (G_OBJECT (frame), "label-yalign");
500 g_object_thaw_notify (G_OBJECT (frame));
501 gtk_widget_queue_resize (GTK_WIDGET (frame));
505 * gtk_frame_get_label_align:
506 * @frame: a #GtkFrame
507 * @xalign: (allow-none): location to store X alignment of frame's label, or %NULL
508 * @yalign: (allow-none): location to store X alignment of frame's label, or %NULL
510 * Retrieves the X and Y alignment of the frame's label. See
511 * gtk_frame_set_label_align().
514 gtk_frame_get_label_align (GtkFrame *frame,
518 GtkFramePrivate *priv;
520 g_return_if_fail (GTK_IS_FRAME (frame));
525 *xalign = priv->label_xalign;
527 *yalign = priv->label_yalign;
531 * gtk_frame_set_shadow_type:
532 * @frame: a #GtkFrame
533 * @type: the new #GtkShadowType
535 * Sets the shadow type for @frame.
538 gtk_frame_set_shadow_type (GtkFrame *frame,
541 GtkFramePrivate *priv;
544 g_return_if_fail (GTK_IS_FRAME (frame));
548 if ((GtkShadowType) priv->shadow_type != type)
550 widget = GTK_WIDGET (frame);
551 priv->shadow_type = type;
552 g_object_notify (G_OBJECT (frame), "shadow-type");
554 if (gtk_widget_is_drawable (widget))
556 gtk_widget_queue_draw (widget);
559 gtk_widget_queue_resize (widget);
564 * gtk_frame_get_shadow_type:
565 * @frame: a #GtkFrame
567 * Retrieves the shadow type of the frame. See
568 * gtk_frame_set_shadow_type().
570 * Return value: the current shadow type of the frame.
573 gtk_frame_get_shadow_type (GtkFrame *frame)
575 g_return_val_if_fail (GTK_IS_FRAME (frame), GTK_SHADOW_ETCHED_IN);
577 return frame->priv->shadow_type;
581 gtk_frame_paint (GtkWidget *widget,
585 GtkFramePrivate *priv;
589 gint x, y, width, height;
591 frame = GTK_FRAME (widget);
594 style = gtk_widget_get_style (widget);
595 window = gtk_widget_get_window (widget);
596 state = gtk_widget_get_state (widget);
598 x = priv->child_allocation.x - style->xthickness;
599 y = priv->child_allocation.y - style->ythickness;
600 width = priv->child_allocation.width + 2 * style->xthickness;
601 height = priv->child_allocation.height + 2 * style->ythickness;
603 if (priv->label_widget)
609 if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
610 xalign = priv->label_xalign;
612 xalign = 1 - priv->label_xalign;
614 height_extra = MAX (0, priv->label_allocation.height - style->ythickness)
615 - priv->label_yalign * priv->label_allocation.height;
617 height += height_extra;
619 x2 = style->xthickness + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
620 /* If the label is completely over or under the frame we can omit the gap */
621 if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
622 gtk_paint_shadow (style, window,
623 state, priv->shadow_type,
624 area, widget, "frame",
625 x, y, width, height);
627 gtk_paint_shadow_gap (style, window,
628 state, priv->shadow_type,
629 area, widget, "frame",
632 x2, priv->label_allocation.width + 2 * LABEL_PAD);
635 gtk_paint_shadow (style, window,
636 state, priv->shadow_type,
637 area, widget, "frame",
638 x, y, width, height);
642 gtk_frame_expose (GtkWidget *widget,
643 GdkEventExpose *event)
645 if (gtk_widget_is_drawable (widget))
647 gtk_frame_paint (widget, &event->area);
649 GTK_WIDGET_CLASS (gtk_frame_parent_class)->expose_event (widget, event);
656 gtk_frame_size_allocate (GtkWidget *widget,
657 GtkAllocation *allocation)
659 GtkFrame *frame = GTK_FRAME (widget);
660 GtkFramePrivate *priv = frame->priv;
661 GtkBin *bin = GTK_BIN (widget);
662 GtkAllocation new_allocation;
665 gtk_widget_set_allocation (widget, allocation);
667 gtk_frame_compute_child_allocation (frame, &new_allocation);
669 /* If the child allocation changed, that means that the frame is drawn
670 * in a new place, so we must redraw the entire widget.
672 if (gtk_widget_get_mapped (widget))
674 gdk_window_invalidate_rect (gtk_widget_get_window (widget), allocation, FALSE);
677 child = gtk_bin_get_child (bin);
678 if (child && gtk_widget_get_visible (child))
679 gtk_widget_size_allocate (child, &new_allocation);
681 priv->child_allocation = new_allocation;
683 if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
686 gint nat_width, width, height;
689 style = gtk_widget_get_style (widget);
691 if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
692 xalign = priv->label_xalign;
694 xalign = 1 - priv->label_xalign;
696 gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
697 width = new_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD;
698 width = MIN (width, nat_width);
700 gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
704 priv->label_allocation.x = priv->child_allocation.x + LABEL_SIDE_PAD +
705 (new_allocation.width - width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_PAD;
707 priv->label_allocation.width = width;
709 priv->label_allocation.y = priv->child_allocation.y - MAX (height, style->ythickness);
710 priv->label_allocation.height = height;
712 gtk_widget_size_allocate (priv->label_widget, &priv->label_allocation);
717 gtk_frame_compute_child_allocation (GtkFrame *frame,
718 GtkAllocation *child_allocation)
720 g_return_if_fail (GTK_IS_FRAME (frame));
721 g_return_if_fail (child_allocation != NULL);
723 GTK_FRAME_GET_CLASS (frame)->compute_child_allocation (frame, child_allocation);
727 gtk_frame_real_compute_child_allocation (GtkFrame *frame,
728 GtkAllocation *child_allocation)
730 GtkFramePrivate *priv = frame->priv;
731 GtkWidget *widget = GTK_WIDGET (frame);
732 GtkAllocation allocation;
737 style = gtk_widget_get_style (widget);
739 gtk_widget_get_allocation (widget, &allocation);
741 border_width = gtk_container_get_border_width (GTK_CONTAINER (frame));
743 if (priv->label_widget)
745 gint nat_width, width, height;
747 gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget), NULL, &nat_width);
749 width = allocation.width;
750 width -= 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
751 width -= (border_width + style->xthickness) * 2;
753 width = MIN (width, nat_width);
755 gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget), width,
758 top_margin = MAX (height, style->ythickness);
761 top_margin = style->ythickness;
763 child_allocation->x = border_width + style->xthickness;
764 child_allocation->y = border_width + top_margin;
765 child_allocation->width = MAX (1, (gint) allocation.width - child_allocation->x * 2);
766 child_allocation->height = MAX (1, ((gint) allocation.height - child_allocation->y -
767 border_width - (gint) style->ythickness));
769 child_allocation->x += allocation.x;
770 child_allocation->y += allocation.y;
774 gtk_frame_get_size (GtkSizeRequest *request,
775 GtkOrientation orientation,
779 GtkFrame *frame = GTK_FRAME (request);
780 GtkFramePrivate *priv = frame->priv;
782 GtkWidget *widget = GTK_WIDGET (request);
784 GtkBin *bin = GTK_BIN (widget);
785 gint child_min, child_nat;
786 gint minimum, natural;
789 style = gtk_widget_get_style (widget);
791 if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
793 if (orientation == GTK_ORIENTATION_HORIZONTAL)
795 gtk_size_request_get_width (GTK_SIZE_REQUEST (priv->label_widget),
796 &child_min, &child_nat);
797 minimum = child_min + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
798 natural = child_nat + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
802 gtk_size_request_get_height (GTK_SIZE_REQUEST (priv->label_widget),
803 &child_min, &child_nat);
804 minimum = MAX (0, child_min - style->ythickness);
805 natural = MAX (0, child_nat - style->ythickness);
814 child = gtk_bin_get_child (bin);
815 if (child && gtk_widget_get_visible (child))
817 if (orientation == GTK_ORIENTATION_HORIZONTAL)
819 gtk_size_request_get_width (GTK_SIZE_REQUEST (child),
820 &child_min, &child_nat);
821 minimum = MAX (minimum, child_min);
822 natural = MAX (natural, child_nat);
826 gtk_size_request_get_height (GTK_SIZE_REQUEST (child),
827 &child_min, &child_nat);
828 minimum += child_min;
829 natural += child_nat;
833 border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
835 if (orientation == GTK_ORIENTATION_HORIZONTAL)
837 minimum += (border_width + style->xthickness) * 2;
838 natural += (border_width + style->xthickness) * 2;
842 minimum += (border_width + style->ythickness) * 2;
843 natural += (border_width + style->ythickness) * 2;
847 *minimum_size = minimum;
850 *natural_size = natural;
854 gtk_frame_get_width (GtkSizeRequest *widget,
858 gtk_frame_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
862 gtk_frame_get_height (GtkSizeRequest *widget,
866 gtk_frame_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
871 gtk_frame_get_height_for_width (GtkSizeRequest *request,
873 gint *minimum_height,
874 gint *natural_height)
876 GtkWidget *widget = GTK_WIDGET (request);
878 GtkFrame *frame = GTK_FRAME (widget);
879 GtkFramePrivate *priv = frame->priv;
880 GtkBin *bin = GTK_BIN (widget);
882 gint child_min, child_nat, label_width;
883 gint minimum, natural;
886 style = gtk_widget_get_style (widget);
888 border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
889 minimum = (border_width + style->ythickness) * 2;
890 natural = (border_width + style->ythickness) * 2;
892 width -= (border_width + style->xthickness) * 2;
893 label_width = width - 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD;
895 if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
897 gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (priv->label_widget),
898 label_width, &child_min, &child_nat);
899 minimum += child_min;
900 natural += child_nat;
903 child = gtk_bin_get_child (bin);
904 if (child && gtk_widget_get_visible (child))
906 gtk_size_request_get_height_for_width (GTK_SIZE_REQUEST (child),
907 width, &child_min, &child_nat);
908 minimum += child_min;
909 natural += child_nat;
913 *minimum_height = minimum;
916 *natural_height = natural;
920 gtk_frame_get_width_for_height (GtkSizeRequest *widget,
925 GTK_SIZE_REQUEST_GET_IFACE (widget)->get_width (widget, minimum_width, natural_width);
929 gtk_frame_size_request_init (GtkSizeRequestIface *iface)
931 iface->get_width = gtk_frame_get_width;
932 iface->get_height = gtk_frame_get_height;
933 iface->get_height_for_width = gtk_frame_get_height_for_width;
934 iface->get_width_for_height = gtk_frame_get_width_for_height;