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 = GtkToggleToolButton.html
27 * outFile = ToggleToolButton
28 * strct = GtkToggleToolButton
30 * ctorStrct=GtkToolItem
31 * clss = ToggleToolButton
39 * - gtk_toggle_tool_button_
48 * - GtkToolItem* -> ToolItem
53 module gtk
.ToggleToolButton
;
59 import tango
.io
.Stdout
; // use the tango loging?
63 private import gtkc
.gtktypes
;
65 private import gtkc
.gtk
;
68 private import glib
.Str
;
69 private import gtk
.ToolItem
;
76 * A GtkToggleToolButton is a GtkToolItem that contains a toggle
78 * Use gtk_toggle_tool_button_new() to create a new
79 * GtkToggleToolButton. Use gtk_toggle_tool_button_new_from_stock() to
80 * create a new GtkToggleToolButton containing a stock item.
82 private import gtk
.ToolButton
;
83 public class ToggleToolButton
: ToolButton
86 /** the main Gtk struct */
87 protected GtkToggleToolButton
* gtkToggleToolButton
;
90 public GtkToggleToolButton
* getToggleToolButtonStruct()
92 return gtkToggleToolButton
;
96 /** the main Gtk struct as a void* */
97 protected void* getStruct()
99 return cast(void*)gtkToggleToolButton
;
103 * Sets our main struct and passes it to the parent class
105 public this (GtkToggleToolButton
* gtkToggleToolButton
)
109 if ( gtkToggleToolButton
is null )
114 Stdout("struct gtkToggleToolButton is null on constructor").newline
;
118 printf("struct gtkToggleToolButton is null on constructor");
125 assert(gtkToggleToolButton
!is null, "struct gtkToggleToolButton is null on constructor");
127 super(cast(GtkToolButton
*)gtkToggleToolButton
);
128 this.gtkToggleToolButton
= gtkToggleToolButton
;
134 // imports for the signal processing
135 private import gobject
.Signals
;
136 private import gtkc
.gdktypes
;
137 int[char[]] connectedSignals
;
139 void delegate(ToggleToolButton
)[] onToggledListeners
;
140 void addOnToggled(void delegate(ToggleToolButton
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
142 if ( !("toggled" in connectedSignals
) )
147 cast(GCallback
)&callBackToggled
,
151 connectedSignals
["toggled"] = 1;
153 onToggledListeners
~= dlg
;
155 extern(C
) static void callBackToggled(GtkToggleToolButton
* toggleToolButtonStruct
, ToggleToolButton toggleToolButton
)
157 bool consumed
= false;
159 foreach ( void delegate(ToggleToolButton
) dlg
; toggleToolButton
.onToggledListeners
)
161 dlg(toggleToolButton
);
170 * Returns a new GtkToggleToolButton
172 * a newly created GtkToggleToolButton
177 // GtkToolItem* gtk_toggle_tool_button_new (void);
178 this(cast(GtkToggleToolButton
*)gtk_toggle_tool_button_new() );
182 * Creates a new GtkToggleToolButton containing the image and text from a
183 * stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK
184 * and GTK_STOCK_APPLY.
185 * It is an error if stock_id is not a name of a stock item.
187 * the name of the stock item
189 * A new GtkToggleToolButton
192 public this (char[] stockId
)
194 // GtkToolItem* gtk_toggle_tool_button_new_from_stock (const gchar *stock_id);
195 this(cast(GtkToggleToolButton
*)gtk_toggle_tool_button_new_from_stock(Str
.toStringz(stockId
)) );
199 * Sets the status of the toggle tool button. Set to TRUE if you
200 * want the GtkToggleButton to be 'pressed in', and FALSE to raise it.
201 * This action causes the toggled signal to be emitted.
203 * a GtkToggleToolButton
205 * whether button should be active
208 public void setActive(int isActive
)
210 // void gtk_toggle_tool_button_set_active (GtkToggleToolButton *button, gboolean is_active);
211 gtk_toggle_tool_button_set_active(gtkToggleToolButton
, isActive
);
215 * Queries a GtkToggleToolButton and returns its current state.
216 * Returns TRUE if the toggle button is pressed in and FALSE if it is raised.
218 * a GtkToggleToolButton
220 * TRUE if the toggle tool button is pressed in, FALSE if not
223 * The "active" property
224 * "active" gboolean : Read / Write
225 * If the toggle tool button should be pressed in or not.
226 * Default value: FALSE
229 * The "toggled" signal
230 * void user_function (GtkToggleToolButton *toggle_tool_button,
231 * gpointer user_data) : Run First
232 * Emitted whenever the toggle tool button changes state.
233 * toggle_tool_button:
234 * the object that emitted the signal
236 * user data set when the signal handler was connected.
238 * GtkToolbar, GtkToolButton, GtkSeparatorToolItem
240 * The parent class of GtkToggleToolButton. The properties
241 * "label_widget", "label", "icon_widget", and "stock_id" on
242 * GtkToolButton determine the label and icon used on
243 * GtkToggleToolButtons.
244 * A subclass of GtkToolItem that separates groups of
245 * items on a toolbar.
247 public int getActive()
249 // gboolean gtk_toggle_tool_button_get_active (GtkToggleToolButton *button);
250 return gtk_toggle_tool_button_get_active(gtkToggleToolButton
);