alternative to assert
[gtkD.git] / gtkD / src / gtk / CheckButton.d
blob0661cbf5254afedee10262517e62b402b8689474
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 = GtkCheckButton.html
26 * outPack = gtk
27 * outFile = CheckButton
28 * strct = GtkCheckButton
29 * realStrct=
30 * ctorStrct=
31 * clss = CheckButton
32 * interf =
33 * class Code: Yes
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_check_button_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * - gtk_check_button_new_with_label
45 * - gtk_check_button_new_with_mnemonic
46 * imports:
47 * - glib.Str
48 * - gtk.Button
49 * - glib.Str
50 * structWrap:
51 * module aliases:
52 * local aliases:
55 module gtk.CheckButton;
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.Button;
72 private import glib.Str;
77 /**
78 * Description
79 * A GtkCheckButton places a discrete GtkToggleButton next to a widget, (usually a GtkLabel). See the section on GtkToggleButton widgets for more information about toggle/check buttons.
80 * The important signal ('toggled') is also inherited from GtkToggleButton.
82 private import gtk.ToggleButton;
83 public class CheckButton : ToggleButton
86 /** the main Gtk struct */
87 protected GtkCheckButton* gtkCheckButton;
90 public GtkCheckButton* getCheckButtonStruct()
92 return gtkCheckButton;
96 /** the main Gtk struct as a void* */
97 protected void* getStruct()
99 return cast(void*)gtkCheckButton;
103 * Sets our main struct and passes it to the parent class
105 public this (GtkCheckButton* gtkCheckButton)
107 version(noAssert)
109 if ( gtkCheckButton is null )
111 int zero = 0;
112 version(Tango)
114 Stdout("struct gtkCheckButton is null on constructor").newline;
116 else
118 printf("struct gtkCheckButton is null on constructor");
120 zero = zero / zero;
123 else
125 assert(gtkCheckButton !is null, "struct gtkCheckButton is null on constructor");
127 super(cast(GtkToggleButton*)gtkCheckButton);
128 this.gtkCheckButton = gtkCheckButton;
132 * Creates a new GtkCheckButton with a GtkLabel to the right of it.
133 * If mnemonic is true the label
134 * will be created using gtk_label_new_with_mnemonic(), so underscores
135 * in label indicate the mnemonic for the check button.
136 * label:
137 * The text of the button, with an underscore in front of the
138 * mnemonic character
139 * label:
140 * the text for the check button.
141 * Returns:
142 * a GtkWidget.
144 public this (char[] label, bool mnemonic=true)
146 if ( mnemonic )
148 // GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label);
149 this(cast(GtkCheckButton*)gtk_check_button_new_with_mnemonic(Str.toStringz(label)) );
151 else
153 // GtkWidget* gtk_check_button_new_with_label (const gchar *label);
154 this(cast(GtkCheckButton*)gtk_check_button_new_with_label(Str.toStringz(label)) );
158 public this(char[] label, void delegate(CheckButton) onClicked, bool mnemonic=true)
160 this(label, mnemonic);
161 addOnClicked(cast(void delegate(Button))onClicked);
170 * Creates a new GtkCheckButton.
171 * Returns:
172 * a GtkWidget.
174 public this ()
176 // GtkWidget* gtk_check_button_new (void);
177 this(cast(GtkCheckButton*)gtk_check_button_new() );