From 00d05564fe963f53d8f56601f0b2dad2834b9b00 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 11 Sep 2012 23:25:56 -0500 Subject: In tests/test-loader and tests/dummy-indicator-visible.c, support hiding & re-showing IndicatorObjectEntries by caching their parent widgetry instead of using gtk_widget_destroy() --- tests/dummy-indicator-visible.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/dummy-indicator-visible.c') diff --git a/tests/dummy-indicator-visible.c b/tests/dummy-indicator-visible.c index 0bb9e89..42cb59c 100644 --- a/tests/dummy-indicator-visible.c +++ b/tests/dummy-indicator-visible.c @@ -88,17 +88,25 @@ G_DEFINE_TYPE (DummyIndicatorVisible, dummy_indicator_visible, INDICATOR_OBJECT_ static void dummy_indicator_entry_being_removed (IndicatorObject * io, IndicatorObjectEntry * entry) { + IndicatorObjectClass * indicator_object_class = INDICATOR_OBJECT_CLASS (dummy_indicator_visible_parent_class); + g_object_set_data(G_OBJECT(entry->label), "is-hidden", GINT_TO_POINTER(1)); - INDICATOR_OBJECT_CLASS(dummy_indicator_visible_parent_class)->entry_being_removed (io, entry); + if (indicator_object_class->entry_being_removed != NULL) { + indicator_object_class->entry_being_removed (io, entry); + } } static void dummy_indicator_entry_was_added (IndicatorObject * io, IndicatorObjectEntry * entry) { + IndicatorObjectClass * indicator_object_class = INDICATOR_OBJECT_CLASS (dummy_indicator_visible_parent_class); + g_object_steal_data(G_OBJECT(entry->label), "is-hidden"); - INDICATOR_OBJECT_CLASS(dummy_indicator_visible_parent_class)->entry_was_added (io, entry); + if (indicator_object_class->entry_was_added != NULL) { + indicator_object_class->entry_was_added (io, entry); + } } static void -- cgit v1.2.3