[libpeas] Fix testing_show_widget()
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Fix testing_show_widget()
- Date: Fri, 11 Feb 2011 10:38:14 +0000 (UTC)
commit b68f81bb0d6679345aafe27c915a6faef7d4fb05
Author: Garrett Regier <alias301 gmail com>
Date: Wed Feb 9 22:37:55 2011 -0800
Fix testing_show_widget()
It now allows you to show a widget with a parent
and no longer add the widget twice in the case that
it had to create a window.
tests/libpeas-gtk/testing/testing.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/libpeas-gtk/testing/testing.c b/tests/libpeas-gtk/testing/testing.c
index 65d29f1..9b58050 100644
--- a/tests/libpeas-gtk/testing/testing.c
+++ b/tests/libpeas-gtk/testing/testing.c
@@ -205,7 +205,9 @@ testing_show_widget (gpointer widget)
g_assert (GTK_IS_WIDGET (widget));
- if (GTK_IS_WINDOW (widget))
+ widget = gtk_widget_get_toplevel (GTK_WIDGET (widget));
+
+ if (gtk_widget_is_toplevel (GTK_WIDGET (widget)))
window = widget;
else
{
@@ -219,8 +221,6 @@ testing_show_widget (gpointer widget)
gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
#endif
- gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (widget));
-
gtk_widget_show_all (window);
g_signal_connect (window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]