* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+
+/*
+ * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
#include "gtkbin.h"
if (!bin_type)
{
- GtkTypeInfo bin_info =
+ static const GtkTypeInfo bin_info =
{
"GtkBin",
sizeof (GtkBin),
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
bin = GTK_BIN (widget);
- if (!GTK_WIDGET_NO_WINDOW (widget))
- gdk_window_show (widget->window);
- else
- gtk_widget_queue_draw (widget);
-
if (bin->child &&
GTK_WIDGET_VISIBLE (bin->child) &&
!GTK_WIDGET_MAPPED (bin->child))
gtk_widget_map (bin->child);
+
+ if (!GTK_WIDGET_NO_WINDOW (widget))
+ gdk_window_show (widget->window);
}
static void
bin = GTK_BIN (widget);
if (GTK_WIDGET_NO_WINDOW (widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ gtk_widget_queue_clear (widget);
else
gdk_window_hide (widget->window);
- if (bin->child &&
- GTK_WIDGET_VISIBLE (bin->child) &&
- GTK_WIDGET_MAPPED (bin->child))
+ if (bin->child && GTK_WIDGET_MAPPED (bin->child))
gtk_widget_unmap (bin->child);
}
g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_BIN (widget));
- if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget))
- {
- bin = GTK_BIN (widget);
+ bin = GTK_BIN (widget);
- if (bin->child &&
+ if (GTK_WIDGET_DRAWABLE (bin))
+ {
+ if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
gtk_widget_intersect (bin->child, area, &child_area))
- gtk_widget_draw (bin->child, &child_area);
+ gtk_widget_draw (bin->child, &child_area);
}
}
bin = GTK_BIN (widget);
child_event = *event;
- if (bin->child &&
+ if (bin->child && GTK_WIDGET_DRAWABLE (bin->child) &&
GTK_WIDGET_NO_WINDOW (bin->child) &&
gtk_widget_intersect (bin->child, &event->area, &child_event.area))
gtk_widget_event (bin->child, (GdkEvent*) &child_event);
gtk_widget_set_parent (child, GTK_WIDGET (bin));
bin->child = child;
- if (GTK_WIDGET_VISIBLE (child->parent))
+ if (GTK_WIDGET_REALIZED (child->parent))
+ gtk_widget_realize (child);
+
+ if (GTK_WIDGET_VISIBLE (child->parent) && GTK_WIDGET_VISIBLE (child))
{
- if (GTK_WIDGET_REALIZED (child->parent) &&
- !GTK_WIDGET_REALIZED (child))
- gtk_widget_realize (child);
-
- if (GTK_WIDGET_MAPPED (child->parent) &&
- !GTK_WIDGET_MAPPED (child))
+ if (GTK_WIDGET_MAPPED (child->parent))
gtk_widget_map (child);
+
+ gtk_widget_queue_resize (child);
}
-
- if (GTK_WIDGET_VISIBLE (child) && GTK_WIDGET_VISIBLE (container))
- gtk_widget_queue_resize (child);
}
static void