+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
+Fri Jun 19 06:18:19 1998 Tim Janik <timj@gtk.org>
+
+ * gtk/gtkcontainer.c (gtk_container_set_resize_mode): fail silently
+ for toplevels. if resize_mode changes to GTK_RESIZE_PARENT, clear the
+ resize widget list before queuing the container for a new reize.
+ (gtk_container_need_resize): changed return value to FALSE, since this
+ used to indicate that no further resizes are needed.
+ (gtk_container_set_arg):
+ (gtk_container_get_arg):
+ (gtk_container_class_init): implemented GtkContainer::resize_mode
+ argument.
+
+ (gtk_container_resize_children): when we walk up the tree of a resize
+ widget we need to stop if we are the current parent.
+
+ * gtk/gtkwidget.c (gtk_widget_queue_resize): flag the resize child with
+ GTK_RESIZE_NEEDED for container->resize_mode==GTK_RESIZE_IMMEDIATE.
+ (gtk_widget_hide_all): retrive the toplevel widget from via
+ gtk_widget_get_resize_container().
+
Thu Jun 18 23:08:36 1998 Owen Taylor <otaylor@gtk.org>
* gtk/gtklist.c (gtk_list_button_press): Only respond
;; generated by makeenums.pl ; -*- scheme -*-
-; enumerations from "../../gtk+/gtk/gtkclist.h"
+; enumerations from "./gtkclist.h"
(define-enum GtkCellType
(empty GTK_CELL_EMPTY)
(pixtext GTK_CELL_PIXTEXT)
(widget GTK_CELL_WIDGET))
-; enumerations from "../../gtk+/gtk/gtkctree.h"
+; enumerations from "./gtkctree.h"
(define-enum GtkCTreePos
(before GTK_CTREE_POS_BEFORE)
(dotted GTK_CTREE_LINES_DOTTED)
(none GTK_CTREE_LINES_NONE))
-; enumerations from "../../gtk+/gtk/gtkdebug.h"
+; enumerations from "./gtkdebug.h"
(define-flags GtkDebugFlag
(objects GTK_DEBUG_OBJECTS)
(misc GTK_DEBUG_MISC)
(signals GTK_DEBUG_SIGNALS))
-; enumerations from "../../gtk+/gtk/gtkenums.h"
+; enumerations from "./gtkenums.h"
(define-flags GtkAccelFlags
(visible GTK_ACCEL_VISIBLE)
(dialog GTK_WINDOW_DIALOG)
(popup GTK_WINDOW_POPUP))
-; enumerations from "../../gtk+/gtk/gtkfontsel.h"
+; enumerations from "./gtkfontsel.h"
(define-enum GtkFontMetricType
(ixels-metric PIXELS_METRIC)
(oints-metric POINTS_METRIC))
-; enumerations from "../../gtk+/gtk/gtkobject.h"
+; enumerations from "./gtkobject.h"
(define-flags GtkObjectFlags
(destroyed GTK_DESTROYED)
(mask GTK_ARG_MASK)
(readwrite GTK_ARG_READWRITE))
-; enumerations from "../../gtk+/gtk/gtkpacker.h"
+; enumerations from "./gtkpacker.h"
(define-flags GtkPackerOptions
(expand GTK_PACK_EXPAND)
(w GTK_ANCHOR_W)
(e GTK_ANCHOR_E))
-; enumerations from "../../gtk+/gtk/gtkprivate.h"
+; enumerations from "./gtkprivate.h"
(define-flags GtkPrivateFlags
(user-style PRIVATE_GTK_USER_STYLE)
(has-shape-mask PRIVATE_GTK_HAS_SHAPE_MASK)
(in-reparent PRIVATE_GTK_IN_REPARENT))
-; enumerations from "../../gtk+/gtk/gtkspinbutton.h"
+; enumerations from "./gtkspinbutton.h"
(define-enum GtkSpinButtonUpdatePolicy
(always GTK_UPDATE_ALWAYS)
(if-valid GTK_UPDATE_IF_VALID))
-; enumerations from "../../gtk+/gtk/gtktoolbar.h"
+; enumerations from "./gtktoolbar.h"
(define-enum GtkToolbarChildType
(space GTK_TOOLBAR_CHILD_SPACE)
(radiobutton GTK_TOOLBAR_CHILD_RADIOBUTTON)
(widget GTK_TOOLBAR_CHILD_WIDGET))
-; enumerations from "../../gtk+/gtk/gtktree.h"
+; enumerations from "./gtktree.h"
(define-enum GtkTreeViewMode
(line GTK_TREE_VIEW_LINE)
(item GTK_TREE_VIEW_ITEM))
-; enumerations from "../../gtk+/gtk/gtktypeutils.h"
+; enumerations from "./gtktypeutils.h"
(define-enum GtkFundamentalType
(invalid GTK_TYPE_INVALID)
(c-callback GTK_TYPE_C_CALLBACK)
(object GTK_TYPE_OBJECT))
-; enumerations from "../../gtk+/gtk/gtkwidget.h"
+; enumerations from "./gtkwidget.h"
(define-flags GtkWidgetFlags
(toplevel GTK_TOPLEVEL)
(rc-style GTK_RC_STYLE)
(basic GTK_BASIC))
-; enumerations from "../../gtk+/gdk/gdkprivate.h"
+; enumerations from "../gdk/gdkprivate.h"
(define-flags GdkDebugFlag
(misc GDK_DEBUG_MISC)
(color-context GDK_DEBUG_COLOR_CONTEXT)
(xim GDK_DEBUG_XIM))
-; enumerations from "../../gtk+/gdk/gdktypes.h"
+; enumerations from "../gdk/gdktypes.h"
(define-enum GdkWindowType
(root GDK_WINDOW_ROOT)
enum {
ARG_0,
ARG_BORDER_WIDTH,
+ ARG_RESIZE_MODE,
ARG_CHILD
};
hadjustment_key_id = g_quark_from_static_string (hadjustment_key);
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_ULONG, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
+ gtk_object_add_arg_type ("GtkContainer::resize_mode", GTK_TYPE_RESIZE_MODE, GTK_ARG_READWRITE, ARG_RESIZE_MODE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
container_signals[ADD] =
case ARG_BORDER_WIDTH:
gtk_container_border_width (container, GTK_VALUE_ULONG (*arg));
break;
+ case ARG_RESIZE_MODE:
+ gtk_container_set_resize_mode (container, GTK_VALUE_ENUM (*arg));
+ break;
case ARG_CHILD:
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
break;
case ARG_BORDER_WIDTH:
GTK_VALUE_ULONG (*arg) = container->border_width;
break;
+ case ARG_RESIZE_MODE:
+ GTK_VALUE_ENUM (*arg) = container->resize_mode;
+ break;
default:
arg->type = GTK_TYPE_INVALID;
break;
{
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
- g_return_if_fail (!(GTK_WIDGET_TOPLEVEL (container) &&
- resize_mode == GTK_RESIZE_PARENT));
-
- container->resize_mode = resize_mode;
-
- if (container->resize_widgets != NULL)
+ g_return_if_fail (resize_mode <= GTK_RESIZE_IMMEDIATE);
+
+ if (GTK_WIDGET_TOPLEVEL (container) &&
+ resize_mode == GTK_RESIZE_PARENT)
+ resize_mode = GTK_RESIZE_QUEUE;
+
+ if (container->resize_mode != resize_mode)
{
- if (resize_mode == GTK_RESIZE_IMMEDIATE)
- gtk_container_check_resize (container);
- else if (resize_mode == GTK_RESIZE_PARENT)
+ container->resize_mode = resize_mode;
+
+ if (container->resize_widgets != NULL)
{
- gtk_widget_queue_resize (GTK_WIDGET (container));
- container->resize_widgets = NULL;
+ if (resize_mode == GTK_RESIZE_IMMEDIATE)
+ gtk_container_check_resize (container);
+ else if (resize_mode == GTK_RESIZE_PARENT)
+ {
+ gtk_container_clear_resize_widgets (container);
+ gtk_widget_queue_resize (GTK_WIDGET (container));
+ }
}
}
}
gtk_container_need_resize (GtkContainer *container)
{
gtk_container_check_resize (container);
- return TRUE;
+ return FALSE;
}
static void
}
}
-/* The window hasn't changed size but one of its children
+/* The container hasn't changed size but one of its children
* queued a resize request. Which means that the allocation
* is not sufficient for the requisition of some child.
* We've already performed a size request at this point,
GSList *resize_containers;
GSList *node;
- resize_widgets = container->resize_widgets;
- container->resize_widgets = NULL;
-
g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_CONTAINER (container));
+ resize_widgets = container->resize_widgets;
+ container->resize_widgets = NULL;
+
for (node = resize_widgets; node; node = node->next)
{
widget = node->data;
{
GtkWidget *toplevel;
- toplevel = gtk_widget_get_toplevel (widget);
+ toplevel = gtk_widget_get_resize_container (widget);
GTK_CONTAINER (toplevel)->resize_widgets =
g_slist_remove (GTK_CONTAINER (toplevel)->resize_widgets, widget);
GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_NEEDED);
break;
case GTK_RESIZE_IMMEDIATE:
- container->resize_widgets =
- g_slist_prepend (container->resize_widgets, widget);
- gtk_container_check_resize (container);
+ if (!GTK_WIDGET_RESIZE_NEEDED (widget))
+ {
+ GTK_PRIVATE_SET_FLAG (widget, GTK_RESIZE_NEEDED);
+ container->resize_widgets =
+ g_slist_prepend (container->resize_widgets, widget);
+ gtk_container_check_resize (container);
+ }
+ break;
case GTK_RESIZE_PARENT:
/* Ignore */
+ break;
}
}
else