summaryrefslogtreecommitdiff
path: root/gladeui/glade-popup.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-03-28 16:34:06 -0400
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-03-28 16:34:06 -0400
commitb45ddd32b53dc1ab26a4b159427e240935fda692 (patch)
treefaf5c9b9033b87f916fd65fbfceacde3e5338398 /gladeui/glade-popup.c
parent3693cac9254023afaad7a681b525851f23eb2a15 (diff)
downloadglade-b45ddd32b53dc1ab26a4b159427e240935fda692.tar.gz
* gladeui/glade-widget-adaptor.[ch]: Add a "scrollable" flag on the adaptor class vtable
introspected by checking if (widget_class->set_scroll_adjustments_signal) != 0. * gladeui/glade-utils.[ch]: Added glade_util_check_and_warn_scrollable() to check and warn the user if they are trying to add a non-scrollable widget to a scrolled window. * gladeui/glade-app.c, gladeui/glade-popup.c, gladeui/glade-placeholder.c, plugins/gtk+/glade-gtk.c: Consult glade_util_check_and_warn_scrollable() before executing commands that introduce objects to the project.
Diffstat (limited to 'gladeui/glade-popup.c')
-rw-r--r--gladeui/glade-popup.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gladeui/glade-popup.c b/gladeui/glade-popup.c
index 84f67b72..0163065a 100644
--- a/gladeui/glade-popup.c
+++ b/gladeui/glade-popup.c
@@ -83,14 +83,20 @@ static void
glade_popup_placeholder_add_cb (GtkMenuItem *item, GladePlaceholder *placeholder)
{
GladeWidgetAdaptor *adaptor;
-
+ GladeWidget *parent;
+
adaptor = glade_palette_get_current_item (glade_app_get_palette ());
g_return_if_fail (adaptor != NULL);
-
- glade_command_create (adaptor, glade_placeholder_get_parent (placeholder),
- placeholder, glade_placeholder_get_project (placeholder));
-
- glade_palette_deselect_current_item (glade_app_get_palette(), TRUE);
+
+ parent = glade_placeholder_get_parent (placeholder);
+
+ if (!glade_util_check_and_warn_scrollable (parent, adaptor, glade_app_get_window()))
+ {
+ glade_command_create (adaptor, parent,
+ placeholder, glade_placeholder_get_project (placeholder));
+
+ glade_palette_deselect_current_item (glade_app_get_palette(), TRUE);
+ }
}
static void