add Gtkmm2ext::detach_menu() that was needed by my previous commit
git-svn-id: svn://localhost/ardour2/branches/3.0@6471 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ca2f505ec1
commit
8f1c6a5a4d
@ -31,6 +31,7 @@ namespace Gtk {
|
||||
class Widget;
|
||||
class Window;
|
||||
class Paned;
|
||||
class Menu;
|
||||
}
|
||||
|
||||
namespace Gtkmm2ext {
|
||||
@ -69,6 +70,7 @@ namespace Gtkmm2ext {
|
||||
void set_decoration (Gtk::Window* win, Gdk::WMDecoration decor);
|
||||
void set_treeview_header_as_default_label(Gtk::TreeViewColumn *c);
|
||||
Glib::RefPtr<Gdk::Drawable> get_bogus_drawable();
|
||||
void detach_menu (Gtk::Menu&);
|
||||
};
|
||||
|
||||
#endif /* __gtkmm2ext_utils_h__ */
|
||||
|
@ -135,3 +135,16 @@ void Gtkmm2ext::set_treeview_header_as_default_label(Gtk::TreeViewColumn* c)
|
||||
gtk_tree_view_column_set_widget( c->gobj(), GTK_WIDGET(0) );
|
||||
}
|
||||
|
||||
void
|
||||
Gtkmm2ext::detach_menu (Gtk::Menu& menu)
|
||||
{
|
||||
/* its possible for a Gtk::Menu to have no gobj() because it has
|
||||
not yet been instantiated. Catch this and provide a safe
|
||||
detach method.
|
||||
*/
|
||||
if (menu.gobj()) {
|
||||
if (menu.get_attach_widget()) {
|
||||
menu.detach ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user