Debian Codegraph @

gtk/src/radiomenuitem.ccg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/misc.h>
18 #include <gtkmm/label.h>
19 #include <gtk/gtk.h>
20
21 typedef Gtk::RadioMenuItem::Group Group; //So that the generate get_group return type is parsed.
22
23 namespace Gtk
24 {
25
26 RadioMenuItem::RadioMenuItem(const Glib::ustring &label, bool mnemonic)
27 :
28 _CONSTRUCT()
29 {
30 add_accel_label(label, mnemonic);
31 }
32
33 RadioMenuItem::RadioMenuItem(Group& groupx)
34 :
35 _CONSTRUCT()
36 {
37 groupx.add(*this);
38 }
39
40 RadioMenuItem::RadioMenuItem(Group& groupx, const Glib::ustring &label, bool mnemonic)
41 :
42 _CONSTRUCT()
43 {
44 groupx.add(*this);
45 add_accel_label(label, mnemonic);
46 }
47
48 void RadioMenuItem::set_group(Group& group)
49 {
50 gtk_radio_menu_item_set_group(gobj(), group.group_);
51
52 //The group will be updated, ready for use with the next radiomenuitem:
53 group = get_group();
54 }
55
56 void RadioMenuItem::reset_group()
57 {
58 gtk_radio_menu_item_set_group(gobj(), nullptr);
59 }
60
61 } // namespace Gtk