5de5ac9b590f61ad913f6baae472942e94d9e084
[ardour.git] / libs / gtkmm2ext / menu_elems.cc
1 /* menu_elems.h
2  *
3  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4  * Copyright (C) 1998-2002 The gtkmm Development Team
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #include <gtk/gtk.h>
22 #include "gtkmm2ext/menu_elems.h"
23
24 using namespace Gtkmm2ext;
25 using namespace Gtk;
26
27 MenuElemNoMnemonic::MenuElemNoMnemonic (const Glib::ustring& label, const CallSlot& slot)
28 {
29         set_child (manage (new MenuItem (label, false)));
30         if(slot) {
31                 child_->signal_activate().connect(slot);
32         }
33         child_->show();
34 }
35
36 CheckMenuElemNoMnemonic::CheckMenuElemNoMnemonic (const Glib::ustring& label, const CallSlot& slot)
37 {
38         CheckMenuItem* item = manage (new CheckMenuItem (label, false));
39         set_child (item);
40         if(slot) {
41                 item->signal_toggled().connect(slot);
42         }
43         child_->show();
44 }