alternative to assert
[gtkD.git] / gtkD / src / gtk / RadioToolButton.d
blob0607f37c8135d0412d2eaff44cbf83532f5e2654
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = GtkRadioToolButton.html
26 * outPack = gtk
27 * outFile = RadioToolButton
28 * strct = GtkRadioToolButton
29 * realStrct=
30 * ctorStrct=GtkToolItem
31 * clss = RadioToolButton
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_radio_tool_button_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - glib.Str
46 * - gtk.ToolItem
47 * - glib.ListSG
48 * structWrap:
49 * - GSList* -> ListSG
50 * - GtkToolItem* -> ToolItem
51 * module aliases:
52 * local aliases:
55 module gtk.RadioToolButton;
57 version(noAssert)
59 version(Tango)
61 import tango.io.Stdout; // use the tango loging?
65 private import gtkc.gtktypes;
67 private import gtkc.gtk;
70 private import glib.Str;
71 private import gtk.ToolItem;
72 private import glib.ListSG;
77 /**
78 * Description
79 * A GtkRadioToolButton is a GtkToolItem that contains a radio button,
80 * that is, a button that is part of a group of toggle buttons where only
81 * one button can be active at a time.
82 * Use gtk_radio_tool_button_new() to create a new
83 * GtkRadioToolButton. use gtk_radio_tool_button_new_from_widget() to
84 * create a new GtkRadioToolButton that is part of the same group as an
85 * existing GtkRadioToolButton. Use
86 * gtk_radio_tool_button_new_from_stock() or
87 * gtk_radio_tool_button_new_from_widget_with_stock() to create a new
88 * GtkRAdioToolButton containing a stock item.
90 private import gtk.ToggleToolButton;
91 public class RadioToolButton : ToggleToolButton
94 /** the main Gtk struct */
95 protected GtkRadioToolButton* gtkRadioToolButton;
98 public GtkRadioToolButton* getRadioToolButtonStruct()
100 return gtkRadioToolButton;
104 /** the main Gtk struct as a void* */
105 protected void* getStruct()
107 return cast(void*)gtkRadioToolButton;
111 * Sets our main struct and passes it to the parent class
113 public this (GtkRadioToolButton* gtkRadioToolButton)
115 version(noAssert)
117 if ( gtkRadioToolButton is null )
119 int zero = 0;
120 version(Tango)
122 Stdout("struct gtkRadioToolButton is null on constructor").newline;
124 else
126 printf("struct gtkRadioToolButton is null on constructor");
128 zero = zero / zero;
131 else
133 assert(gtkRadioToolButton !is null, "struct gtkRadioToolButton is null on constructor");
135 super(cast(GtkToggleToolButton*)gtkRadioToolButton);
136 this.gtkRadioToolButton = gtkRadioToolButton;
144 * Creates a new GtkRadioToolButton, adding it to group.
145 * group:
146 * An existing radio button group, or NULL if you are creating a new group
147 * Returns:
148 * The new GtkRadioToolButton
149 * Since 2.4
151 public this (ListSG group)
153 // GtkToolItem* gtk_radio_tool_button_new (GSList *group);
154 this(cast(GtkRadioToolButton*)gtk_radio_tool_button_new((group is null) ? null : group.getListSGStruct()) );
158 * Creates a new GtkRadioToolButton, adding it to group.
159 * The new GtkRadioToolButton will contain an icon and label from the
160 * stock item indicated by stock_id.
161 * group:
162 * an existing radio button group, or NULL if you are creating a new group
163 * stock_id:
164 * the name of a stock item
165 * Returns:
166 * The new GtkRadioToolItem
167 * Since 2.4
169 public this (ListSG group, char[] stockId)
171 // GtkToolItem* gtk_radio_tool_button_new_from_stock (GSList *group, const gchar *stock_id);
172 this(cast(GtkRadioToolButton*)gtk_radio_tool_button_new_from_stock((group is null) ? null : group.getListSGStruct(), Str.toStringz(stockId)) );
176 * Creates a new GtkRadioToolButton adding it to the same group as gruup
177 * group:
178 * An existing GtkRadioToolButton
179 * Returns:
180 * The new GtkRadioToolButton
181 * Since 2.4
183 public this ()
185 // GtkToolItem* gtk_radio_tool_button_new_from_widget (GtkRadioToolButton *group);
186 this(cast(GtkRadioToolButton*)gtk_radio_tool_button_new_from_widget(gtkRadioToolButton) );
190 * Creates a new GtkRadioToolButton adding it to the same group as group.
191 * The new GtkRadioToolButton will contain an icon and label from the
192 * stock item indicated by stock_id.
193 * group:
194 * An existing GtkRadioToolButton.
195 * stock_id:
196 * the name of a stock item
197 * Returns:
198 * A new GtkRadioToolButton
199 * Since 2.4
201 public this (char[] stockId)
203 // GtkToolItem* gtk_radio_tool_button_new_with_stock_from_widget (GtkRadioToolButton *group, const gchar *stock_id);
204 this(cast(GtkRadioToolButton*)gtk_radio_tool_button_new_with_stock_from_widget(gtkRadioToolButton, Str.toStringz(stockId)) );
208 * Returns the radio button group button belongs to.
209 * button:
210 * a GtkRadioToolButton
211 * Returns:
212 * The group button belongs to.
213 * Since 2.4
215 public ListSG getGroup()
217 // GSList* gtk_radio_tool_button_get_group (GtkRadioToolButton *button);
218 return new ListSG( gtk_radio_tool_button_get_group(gtkRadioToolButton) );
222 * Adds button to group, removing it from the group it belonged to before.
223 * button:
224 * a GtkRadioToolButton
225 * group:
226 * an existing radio button group
227 * Since 2.4
228 * Property Details
229 * The "group" property
230 * "group" GtkRadioToolButton : Write
231 * Sets a new group for a radio tool button.
232 * Since 2.4
233 * See Also
234 * GtkToolbar
235 * The toolbar widget
236 * GtkToolButton
237 * An ancestor class of GtkRadioToolButton. The properties
238 * "label_widget", "label", "icon_widget", and "stock_id" on
239 * GtkToolButton determine the label and icon used on a
240 * GtkRadioToolButton.
241 * GtkSeparatorToolItem
242 * A subclass of GtkToolItem that separates groups of
243 * items on a toolbar. It is usually a good idea to put a separator
244 * before and after a group of GtkRadioToolButtons on a GtkToolbar.
246 public void setGroup(ListSG group)
248 // void gtk_radio_tool_button_set_group (GtkRadioToolButton *button, GSList *group);
249 gtk_radio_tool_button_set_group(gtkRadioToolButton, (group is null) ? null : group.getListSGStruct());