From b8806b4988a36fbcdc3cc2f9ab35af6ab0e3147f Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Sun, 15 Mar 2009 00:21:57 -0400 Subject: [PATCH] Add functions to get the body/side children. --- aspectbin-glade.c | 6 ++++-- aspectbin.c | 12 ++++++++++++ aspectbin.h | 2 ++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/aspectbin-glade.c b/aspectbin-glade.c index 7a52064..7743279 100644 --- a/aspectbin-glade.c +++ b/aspectbin-glade.c @@ -11,7 +11,9 @@ void aspect_bin_post_create(GladeWidgetAdaptor *adaptor, abin = ASPECT_BIN(object); if (reason == GLADE_CREATE_USER) { - gtk_container_add(GTK_CONTAINER(abin), glade_placeholder_new()); - gtk_container_add(GTK_CONTAINER(abin), glade_placeholder_new()); + if (!aspect_bin_get_body(abin)) + aspect_bin_set_body(abin, glade_placeholder_new(), 1); + if (!aspect_bin_get_side(abin)) + aspect_bin_set_side(abin, glade_placeholder_new()); } } diff --git a/aspectbin.c b/aspectbin.c index 2ce72bd..8ab752c 100644 --- a/aspectbin.c +++ b/aspectbin.c @@ -253,3 +253,15 @@ void aspect_bin_set_side(AspectBin *abin, GtkWidget *widget) if (set_widget(&abin->side, GTK_WIDGET(abin), widget)) gtk_widget_queue_resize(GTK_WIDGET(abin)); } + +GtkWidget *aspect_bin_get_body(AspectBin *abin) +{ + g_return_val_if_fail(IS_ASPECT_BIN(abin), NULL); + return abin->body; +} + +GtkWidget *aspect_bin_get_side(AspectBin *abin) +{ + g_return_val_if_fail(IS_ASPECT_BIN(abin), NULL); + return abin->side; +} diff --git a/aspectbin.h b/aspectbin.h index b4ce50d..5def388 100644 --- a/aspectbin.h +++ b/aspectbin.h @@ -32,5 +32,7 @@ GType aspect_bin_get_type(void); GtkWidget *aspect_bin_new(void); void aspect_bin_set_body(AspectBin *, GtkWidget *, gfloat); void aspect_bin_set_side(AspectBin *, GtkWidget *); +GtkWidget *aspect_bin_get_body(AspectBin *abin); +GtkWidget *aspect_bin_get_side(AspectBin *abin); #endif -- 2.43.2