2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkRadioMenuItem.html
27 * outFile = RadioMenuItem
28 * strct = GtkRadioMenuItem
31 * clss = RadioMenuItem
39 * - gtk_radio_menu_item_
44 * - gtk_radio_menu_item_new_with_label
45 * - gtk_radio_menu_item_new_with_mnemonic
46 * - gtk_radio_menu_item_new_with_mnemonic_from_widget
47 * - gtk_radio_menu_item_new_with_label_from_widget
56 module gtk
.RadioMenuItem
;
58 private import gtk
.gtktypes
;
60 private import lib
.gtk
;
62 private import glib
.Str
;
63 private import glib
.ListSG
;
67 * A radio menu item is a check menu item that belongs to a group. At each
68 * instant exactly one of the radio menu items from a group is selected.
69 * The group list does not need to be freed, as each GtkRadioMenuItem will
70 * remove itself and its list item when it is destroyed.
71 * The correct way to create a group of radio menu items is approximatively
73 * Example3.How to create a group of radio menu items.
74 * GSList *group = NULL;
77 * for (i = 0; i < 5; i++)
79 * item = gtk_radio_menu_item_new_with_label (group, "This is an example");
80 * group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
82 * gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE);
85 private import gtk
.CheckMenuItem
;
86 public class RadioMenuItem
: CheckMenuItem
89 /** the main Gtk struct */
90 protected GtkRadioMenuItem
* gtkRadioMenuItem
;
93 public GtkRadioMenuItem
* getRadioMenuItemStruct()
95 return gtkRadioMenuItem
;
99 /** the main Gtk struct as a void* */
100 protected void* getStruct()
102 return cast(void*)gtkRadioMenuItem
;
106 * Sets our main struct and passes it to the parent class
108 public this (GtkRadioMenuItem
* gtkRadioMenuItem
)
110 super(cast(GtkCheckMenuItem
*)gtkRadioMenuItem
);
111 this.gtkRadioMenuItem
= gtkRadioMenuItem
;
115 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
116 * The new GtkRadioMenuItem is added to the same group as group.
117 * If mnemonic is true the label will be
118 * created using gtk_label_new_with_mnemonic(), so underscores in label
119 * indicate the mnemonic for the menu item.
121 * an existing GtkRadioMenuItem
123 * the text for the label
125 * The new GtkRadioMenuItem
128 public this (RadioMenuItem radioMenuItem
, char[] label
, bit mnemonic
=true)
132 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic_from_widget (GtkRadioMenuItem *group, const gchar *label);
133 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new_with_mnemonic_from_widget(
134 radioMenuItem
.getRadioMenuItemStruct(), Str
.toStringz(label
)) );
138 // GtkWidget* gtk_radio_menu_item_new_with_label_from_widget (GtkRadioMenuItem *group, const gchar *label);
139 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new_with_label_from_widget(
140 radioMenuItem
.getRadioMenuItemStruct(), Str
.toStringz(label
)) );
145 * Creates a new GtkRadioMenuItem containing a label. T
146 * The new GtkRadioMenuItem is added to the same group as group.
148 * An existing GtkRadioMenuItem
150 * the text of the button, with an underscore in front of the
153 * The new GtkRadioMenuItem
156 public this (char[] label
)
161 * Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
162 * If mnemonic is true the label
163 * will be created using gtk_label_new_with_mnemonic(), so underscores
164 * in label indicate the mnemonic for the menu item.
166 * the group to which the radio menu item is to be attached
168 * the text for the label
170 * a new GtkRadioMenuItem
172 public this (ListSG group
, char[] label
, bit mnemonic
=true)
176 // GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group, const gchar *label);
177 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new_with_mnemonic(
178 group
is null ?
null : group
.getListSGStruct(), Str
.toStringz(label
)) );
182 // GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group, const gchar *label);
183 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new_with_label(
184 group
is null ?
null : group
.getListSGStruct(), Str
.toStringz(label
)) );
191 // imports for the signal processing
192 private import gobject
.Signals
;
193 private import gdk
.gdktypes
;
194 int[char[]] connectedSignals
;
196 void delegate(RadioMenuItem
)[] onGroupChangedListeners
;
197 void addOnGroupChanged(void delegate(RadioMenuItem
) dlg
)
199 if ( !("group-changed" in connectedSignals
) )
204 cast(GCallback
)&callBackGroupChanged
,
207 cast(ConnectFlags
)0);
208 connectedSignals
["group-changed"] = 1;
210 onGroupChangedListeners
~= dlg
;
212 extern(C
) static void callBackGroupChanged(GtkRadioMenuItem
* radiomenuitemStruct
, RadioMenuItem radioMenuItem
)
214 bit consumed
= false;
216 foreach ( void delegate(RadioMenuItem
) dlg
; radioMenuItem
.onGroupChangedListeners
)
227 * Creates a new GtkRadioMenuItem.
229 * the group to which the radio menu item is to be attached
231 * a new GtkRadioMenuItem
233 public this (ListSG group
)
235 // GtkWidget* gtk_radio_menu_item_new (GSList *group);
236 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new((group
is null) ?
null : group
.getListSGStruct()) );
242 * Creates a new GtkRadioMenuItem adding it to the same group as group.
244 * An existing GtkRadioMenuItem
246 * The new GtkRadioMenuItem
251 // GtkWidget* gtk_radio_menu_item_new_from_widget (GtkRadioMenuItem *group);
252 this(cast(GtkRadioMenuItem
*)gtk_radio_menu_item_new_from_widget(gtkRadioMenuItem
) );
259 * Sets the group of a radio menu item, or changes it.
261 * a GtkRadioMenuItem.
265 public void setGroup(ListSG group
)
267 // void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item, GSList *group);
268 gtk_radio_menu_item_set_group(gtkRadioMenuItem
, (group
is null) ?
null : group
.getListSGStruct());
272 * Returns the group to which the radio menu item belongs, as a GList of
273 * GtkRadioMenuItem. The list belongs to GTK+ and should not be freed.
275 * a GtkRadioMenuItem.
277 * the group of radio_menu_item.
279 * The "group" property
280 * "group" GtkRadioMenuItem : Write
281 * The radio menu item whose group this widget belongs to.
284 * The "group-changed" signal
285 * void user_function (GtkRadioMenuItem *radiomenuitem,
286 * gpointer user_data) : Run first
288 * the object which received the signal.
290 * user data set when the signal handler was connected.
293 * because a radio menu item is a menu item.
295 * to know how to handle the check.
297 public ListSG
getGroup()
299 // GSList* gtk_radio_menu_item_get_group (GtkRadioMenuItem *radio_menu_item);
300 return new ListSG( gtk_radio_menu_item_get_group(gtkRadioMenuItem
) );