From 3dda0dcf7d4856d598a2a0e7553e71dbd59134eb Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Mon, 6 Apr 2009 23:33:08 +0000 Subject: Basic infobars on linux. All infobars consist of nothing but a non-functioning close button. Review URL: http://codereview.chromium.org/62070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13206 0039d316-1c4b-4281-b951-d872f2087c98 --- base/gfx/gtk_util.cc | 13 +++++++++++++ base/gfx/gtk_util.h | 3 +++ 2 files changed, 16 insertions(+) (limited to 'base/gfx') diff --git a/base/gfx/gtk_util.cc b/base/gfx/gtk_util.cc index 1b0fc31..ba93c34 100755 --- a/base/gfx/gtk_util.cc +++ b/base/gfx/gtk_util.cc @@ -10,6 +10,15 @@ #include "base/gfx/rect.h" #include "skia/include/SkBitmap.h" +namespace { + +// Callback used in RemoveAllChildren. +void RemoveWidget(GtkWidget* widget, gpointer container) { + gtk_container_remove(GTK_CONTAINER(container), widget); +} + +} // namespace + namespace gfx { const GdkColor kGdkWhite = GDK_COLOR_RGB(0xff, 0xff, 0xff); @@ -79,4 +88,8 @@ GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, return ebox; } +void RemoveAllChildren(GtkWidget* container) { + gtk_container_foreach(GTK_CONTAINER(container), RemoveWidget, container); +} + } // namespace gfx diff --git a/base/gfx/gtk_util.h b/base/gfx/gtk_util.h index 6407554..6a6cdd6 100755 --- a/base/gfx/gtk_util.h +++ b/base/gfx/gtk_util.h @@ -39,6 +39,9 @@ GdkPixbuf* GdkPixbufFromSkBitmap(const SkBitmap* bitmap); GtkWidget* CreateGtkBorderBin(GtkWidget* child, const GdkColor* color, int top, int bottom, int left, int right); +// Remove all children from this container. +void RemoveAllChildren(GtkWidget* container); + } // namespace gfx #endif // BASE_GFX_GTK_UTIL_H_ -- cgit v1.1