X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fwidget_gradient.cpp;h=596fedad066c0268dc76be48a23bfe495a27097f;hb=ee303c8406912a41b5e6c838b131c0777abd8014;hp=20c6aa6cacd554cc925b753238be9d6bf8a17a21;hpb=1a1cca647b70d2f38b1d68a3d9007c2f85dd192a;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp b/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp index 20c6aa6..596feda 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_gradient.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -35,6 +36,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -211,6 +214,7 @@ void Widget_Gradient::popup_menu(float x) { Gtk::Menu* menu(manage(new Gtk::Menu())); + menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu)); menu->items().clear(); @@ -291,6 +295,7 @@ Widget_Gradient::on_event(GdkEvent *event) case GDK_MOTION_NOTIFY: if(editable_ && y>get_height()-CONTROL_HEIGHT) { + if(!gradient_.size()) return true; Gradient::iterator iter(gradient_.find(selected_cpoint)); if(event->button.state&GDK_SHIFT_MASK)