static synfig::String app_base_path_;
namespace studio {
+
+bool
+really_delete_widget(Gtk::Widget *widget)
+{
+ synfig::info("really delete %x", (unsigned int)widget);
+ delete widget;
+ return false;
+}
+
+// nasty workaround - when we've finished with a popup menu, we want to delete it
+// attaching to the signal_hide() signal gets us here before the action on the menu has run,
+// so schedule the real delete to happen in 50ms, giving the action a chance to run
+void
+delete_widget(Gtk::Widget *widget)
+{
+ synfig::info("delete %x", (unsigned int)widget);
+ Glib::signal_timeout().connect(sigc::bind(sigc::ptr_fun(&really_delete_widget), widget), 50);
+}
+
}; // END of namespace studio
studio::StateManager* state_manager;
static synfig::String get_config_file(const synfig::String& file);
}; // END of class App
+ void delete_widget(Gtk::Widget *widget);
+
}; // END namespace studio
/* === E N D =============================================================== */
parammenu.items().clear();
Gtk::Menu *newlayers(manage(new Gtk::Menu()));
+ // do we need this? the code is all #ifdef'ed out anyway
+ // newlayers->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), newlayers));
build_new_layer_menu(*newlayers);
parammenu.items().push_back(Gtk::Menu_Helpers::MenuElem("New Layer",*newlayers));
case 2:
{
Gtk::Menu* waypoint_menu(manage(new Gtk::Menu()));
+ waypoint_menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), waypoint_menu));
waypoint_menu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-jump-to"),
sigc::bind(
n=synfig::waypoint_collect(waypoint_set,time,node);
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
// Create the interpolation method menu
if(!waypoint_set.empty())
{
Gtk::Menu* interp_menu(manage(new Gtk::Menu()));
+ // no need to connect to signal_hide for this one - it will be deleted when its parent is deleted
Waypoint::Model model;
// note: each of the following 4 'if' blocks provokes these warnings:
{
synfigapp::ValueDesc value_desc(row[model.value_desc]);
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f);
menu->popup(event->button.button,gtk_get_current_event_time());
return true;
}
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
std::list<synfigapp::ValueDesc> value_desc_list;
ParamDesc param_desc(row[model.param_desc]);
for(;!layer_list.empty();layer_list.pop_back())
{
synfigapp::ValueDesc value_desc(row[param_model.value_desc]);
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f);
menu->popup(event->button.button,gtk_get_current_event_time());
return true;
}
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
std::list<synfigapp::ValueDesc> value_desc_list;
ParamDesc param_desc(row[param_model.param_desc]);
for(;!layer_list.empty();layer_list.pop_back())
Dock_PalEdit::show_menu(int i)
{
Gtk::Menu* menu(manage(new Gtk::Menu()));
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
menu->items().push_back(Gtk::Menu_Helpers::StockMenuElem(Gtk::StockID("gtk-select-color"),
sigc::bind(
}
Gtk::Menu *menu=manage(new Gtk::Menu());
+ menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
canvas_view->get_instance()->make_param_menu(menu,canvas_view->get_canvas(),value_desc_list);
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();