1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19  
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 /*
25  * Conversion parameters:
26  * inFile  = GtkButton.html
27  * outPack = gtk
28  * outFile = Button
29  * strct   = GtkButton
30  * realStrct=
31  * ctorStrct=
32  * clss    = Button
33  * interf  = 
34  * class Code: Yes
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * 	- ActionableIF
40  * 	- ActivatableIF
41  * prefixes:
42  * 	- gtk_button_
43  * omit structs:
44  * omit prefixes:
45  * omit code:
46  * 	- gtk_button_new_with_mnemonic
47  * 	- gtk_button_new_with_label
48  * 	- gtk_button_new_from_stock
49  * omit signals:
50  * imports:
51  * 	- glib.Str
52  * 	- gtk.Image
53  * 	- gdk.Window
54  * 	- gtk.Widget
55  * 	- gtk.ActionableIF
56  * 	- gtk.ActionableT
57  * 	- gtk.ActivatableT
58  * 	- gtk.ActivatableIF
59  * structWrap:
60  * 	- GdkWindow* -> Window
61  * 	- GtkWidget* -> Widget
62  * module aliases:
63  * local aliases:
64  * overrides:
65  */
66 
67 module gtk.Button;
68 
69 public  import gtkc.gtktypes;
70 
71 private import gtkc.gtk;
72 private import glib.ConstructionException;
73 private import gobject.ObjectG;
74 
75 private import gobject.Signals;
76 public  import gtkc.gdktypes;
77 
78 private import glib.Str;
79 private import gtk.Image;
80 private import gdk.Window;
81 private import gtk.Widget;
82 private import gtk.ActionableIF;
83 private import gtk.ActionableT;
84 private import gtk.ActivatableT;
85 private import gtk.ActivatableIF;
86 
87 
88 
89 private import gtk.Bin;
90 
91 /**
92  * The GtkButton widget is generally used to trigger a callback function that is
93  * called when the button is pressed. The various signals and how to use them
94  * are outlined below.
95  *
96  * The GtkButton widget can hold any valid child widget. That is, it can hold
97  * almost any other standard GtkWidget. The most commonly used child is the
98  * GtkLabel.
99  */
100 public class Button : Bin, ActionableIF, ActivatableIF
101 {
102 	
103 	/** the main Gtk struct */
104 	protected GtkButton* gtkButton;
105 	
106 	
107 	public GtkButton* getButtonStruct()
108 	{
109 		return gtkButton;
110 	}
111 	
112 	
113 	/** the main Gtk struct as a void* */
114 	protected override void* getStruct()
115 	{
116 		return cast(void*)gtkButton;
117 	}
118 	
119 	/**
120 	 * Sets our main struct and passes it to the parent class
121 	 */
122 	public this (GtkButton* gtkButton)
123 	{
124 		super(cast(GtkBin*)gtkButton);
125 		this.gtkButton = gtkButton;
126 	}
127 	
128 	protected override void setStruct(GObject* obj)
129 	{
130 		super.setStruct(obj);
131 		gtkButton = cast(GtkButton*)obj;
132 	}
133 	
134 	private static IconSize currentIconSize = IconSize.BUTTON;
135 	
136 	// add the Actionable capabilities
137 	mixin ActionableT!(GtkButton);
138 	
139 	// add the Activatable capabilities
140 	mixin ActivatableT!(GtkButton);
141 	
142 	/** */
143 	public static void setIconSize(IconSize iconSize)
144 	{
145 		currentIconSize = iconSize;
146 	}
147 	
148 	/** */
149 	public static IconSize getIconSize()
150 	{
151 		return currentIconSize;
152 	}
153 	
154 	/**
155 	 * Creates a new GtkButton containing a label.
156 	 * If characters in label are preceded by an underscore, they are underlined.
157 	 * If you need a literal underscore character in a label, use '__' (two
158 	 * underscores). The first underlined character represents a keyboard
159 	 * accelerator called a mnemonic.
160 	 * Pressing Alt and that key activates the button.
161 	 * Params:
162 	 *  label = The text of the button, with an underscore in front of the
163 	 *  mnemonic character
164 	 *  mnemonic = true if the button has an mnemnonic
165 	 * Returns:
166 	 *  a new GtkButton
167 	 * Throws: ConstructionException GTK+ fails to create the object.
168 	 */
169 	public this (string label, bool mnemonic=true)
170 	{
171 		GtkButton* p;
172 		
173 		if ( mnemonic )
174 		{
175 			// GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
176 			p = cast(GtkButton*)gtk_button_new_with_mnemonic(Str.toStringz(label));
177 		}
178 		else
179 		{
180 			// GtkWidget* gtk_button_new_with_label (const gchar *label);
181 			p = cast(GtkButton*)gtk_button_new_with_label(Str.toStringz(label));
182 		}
183 		
184 		if(p is null)
185 		{
186 			throw new ConstructionException("null returned by gtk_button_new_with_label");
187 		}
188 		
189 		this(p);
190 	}
191 	
192 	/**
193 	 * Creates a new GtkButton containing the image and text from a stock item.
194 	 * Some stock ids have preprocessor macros like GTK_STOCK_OK and
195 	 * GTK_STOCK_APPLY.
196 	 * If stock_id is unknown, then it will be treated as a mnemonic
197 	 * label (as for gtk_button_new_with_mnemonic()).
198 	 * Params:
199 	 *  StockID = the name of the stock item
200 	 * Throws: ConstructionException GTK+ fails to create the object.
201 	 */
202 	public this (StockID stockID, bool hideLabel=false)
203 	{
204 		// GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
205 		if ( hideLabel )
206 		{
207 			this();
208 			Image image = new Image(stockID,currentIconSize);
209 			add(image);
210 		}
211 		else
212 		{
213 			auto p = gtk_button_new_from_stock(Str.toStringz(StockDesc[stockID]));
214 			
215 			if(p is null)
216 			{
217 				throw new ConstructionException("null returned by gtk_button_new_from_stock");
218 			}
219 			
220 			this(cast(GtkButton*) p);
221 		}
222 	}
223 	
224 	/** */
225 	public this(StockID stockID, void delegate(Button) dlg, bool hideLabel=false)
226 	{
227 		this(stockID, hideLabel);
228 		addOnClicked(dlg);
229 	}
230 	
231 	/** */
232 	public this(string label, void delegate(Button) dlg, bool mnemonic=true)
233 	{
234 		this(label, mnemonic);
235 		addOnClicked(dlg);
236 	}
237 	
238 	/** */
239 	public this(string label, void delegate(Button) dlg, string action)
240 	{
241 		this(label);
242 		setActionName(action);
243 		addOnClicked(dlg);
244 	}
245 	
246 	/**
247 	 */
248 	int[string] connectedSignals;
249 	
250 	void delegate(Button)[] onActivateListeners;
251 	/**
252 	 * The ::activate signal on GtkButton is an action signal and
253 	 * emitting it causes the button to animate press then release.
254 	 * Applications should never connect to this signal, but use the
255 	 * "clicked" signal.
256 	 */
257 	void addOnActivate(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
258 	{
259 		if ( !("activate" in connectedSignals) )
260 		{
261 			Signals.connectData(
262 			getStruct(),
263 			"activate",
264 			cast(GCallback)&callBackActivate,
265 			cast(void*)this,
266 			null,
267 			connectFlags);
268 			connectedSignals["activate"] = 1;
269 		}
270 		onActivateListeners ~= dlg;
271 	}
272 	extern(C) static void callBackActivate(GtkButton* widgetStruct, Button _button)
273 	{
274 		foreach ( void delegate(Button) dlg ; _button.onActivateListeners )
275 		{
276 			dlg(_button);
277 		}
278 	}
279 	
280 	void delegate(Button)[] onClickedListeners;
281 	/**
282 	 * Emitted when the button has been activated (pressed and released).
283 	 */
284 	void addOnClicked(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
285 	{
286 		if ( !("clicked" in connectedSignals) )
287 		{
288 			Signals.connectData(
289 			getStruct(),
290 			"clicked",
291 			cast(GCallback)&callBackClicked,
292 			cast(void*)this,
293 			null,
294 			connectFlags);
295 			connectedSignals["clicked"] = 1;
296 		}
297 		onClickedListeners ~= dlg;
298 	}
299 	extern(C) static void callBackClicked(GtkButton* buttonStruct, Button _button)
300 	{
301 		foreach ( void delegate(Button) dlg ; _button.onClickedListeners )
302 		{
303 			dlg(_button);
304 		}
305 	}
306 	
307 	void delegate(Button)[] onEnterListeners;
308 	/**
309 	 * Warning
310 	 * GtkButton::enter has been deprecated since version 2.8 and should not be used in newly-written code. Use the "enter-notify-event" signal.
311 	 * Emitted when the pointer enters the button.
312 	 */
313 	void addOnEnter(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
314 	{
315 		if ( !("enter" in connectedSignals) )
316 		{
317 			Signals.connectData(
318 			getStruct(),
319 			"enter",
320 			cast(GCallback)&callBackEnter,
321 			cast(void*)this,
322 			null,
323 			connectFlags);
324 			connectedSignals["enter"] = 1;
325 		}
326 		onEnterListeners ~= dlg;
327 	}
328 	extern(C) static void callBackEnter(GtkButton* buttonStruct, Button _button)
329 	{
330 		foreach ( void delegate(Button) dlg ; _button.onEnterListeners )
331 		{
332 			dlg(_button);
333 		}
334 	}
335 	
336 	void delegate(Button)[] onLeaveListeners;
337 	/**
338 	 * Warning
339 	 * GtkButton::leave has been deprecated since version 2.8 and should not be used in newly-written code. Use the "leave-notify-event" signal.
340 	 * Emitted when the pointer leaves the button.
341 	 */
342 	void addOnLeave(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
343 	{
344 		if ( !("leave" in connectedSignals) )
345 		{
346 			Signals.connectData(
347 			getStruct(),
348 			"leave",
349 			cast(GCallback)&callBackLeave,
350 			cast(void*)this,
351 			null,
352 			connectFlags);
353 			connectedSignals["leave"] = 1;
354 		}
355 		onLeaveListeners ~= dlg;
356 	}
357 	extern(C) static void callBackLeave(GtkButton* buttonStruct, Button _button)
358 	{
359 		foreach ( void delegate(Button) dlg ; _button.onLeaveListeners )
360 		{
361 			dlg(_button);
362 		}
363 	}
364 	
365 	void delegate(Button)[] onPressedListeners;
366 	/**
367 	 * Warning
368 	 * GtkButton::pressed has been deprecated since version 2.8 and should not be used in newly-written code. Use the "button-press-event" signal.
369 	 * Emitted when the button is pressed.
370 	 */
371 	void addOnPressed(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
372 	{
373 		if ( !("pressed" in connectedSignals) )
374 		{
375 			Signals.connectData(
376 			getStruct(),
377 			"pressed",
378 			cast(GCallback)&callBackPressed,
379 			cast(void*)this,
380 			null,
381 			connectFlags);
382 			connectedSignals["pressed"] = 1;
383 		}
384 		onPressedListeners ~= dlg;
385 	}
386 	extern(C) static void callBackPressed(GtkButton* buttonStruct, Button _button)
387 	{
388 		foreach ( void delegate(Button) dlg ; _button.onPressedListeners )
389 		{
390 			dlg(_button);
391 		}
392 	}
393 	
394 	void delegate(Button)[] onReleasedListeners;
395 	/**
396 	 * Warning
397 	 * GtkButton::released has been deprecated since version 2.8 and should not be used in newly-written code. Use the "button-release-event" signal.
398 	 * Emitted when the button is released.
399 	 */
400 	void addOnReleased(void delegate(Button) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
401 	{
402 		if ( !("released" in connectedSignals) )
403 		{
404 			Signals.connectData(
405 			getStruct(),
406 			"released",
407 			cast(GCallback)&callBackReleased,
408 			cast(void*)this,
409 			null,
410 			connectFlags);
411 			connectedSignals["released"] = 1;
412 		}
413 		onReleasedListeners ~= dlg;
414 	}
415 	extern(C) static void callBackReleased(GtkButton* buttonStruct, Button _button)
416 	{
417 		foreach ( void delegate(Button) dlg ; _button.onReleasedListeners )
418 		{
419 			dlg(_button);
420 		}
421 	}
422 	
423 	
424 	/**
425 	 * Creates a new GtkButton widget. To add a child widget to the button,
426 	 * use gtk_container_add().
427 	 * Throws: ConstructionException GTK+ fails to create the object.
428 	 */
429 	public this ()
430 	{
431 		// GtkWidget * gtk_button_new (void);
432 		auto p = gtk_button_new();
433 		if(p is null)
434 		{
435 			throw new ConstructionException("null returned by gtk_button_new()");
436 		}
437 		this(cast(GtkButton*) p);
438 	}
439 	
440 	/**
441 	 * Creates a new button containing an icon from the current icon theme.
442 	 * If the icon name isn't known, a "broken image" icon will be
443 	 * displayed instead. If the current icon theme is changed, the icon
444 	 * will be updated appropriately.
445 	 * This function is a convenience wrapper around gtk_button_new() and
446 	 * gtk_button_set_image().
447 	 * Params:
448 	 * iconName = an icon name
449 	 * size = an icon size. [type int]
450 	 * Throws: ConstructionException GTK+ fails to create the object.
451 	 */
452 	public this (string iconName, GtkIconSize size)
453 	{
454 		// GtkWidget * gtk_button_new_from_icon_name (const gchar *icon_name,  GtkIconSize size);
455 		auto p = gtk_button_new_from_icon_name(Str.toStringz(iconName), size);
456 		if(p is null)
457 		{
458 			throw new ConstructionException("null returned by gtk_button_new_from_icon_name(Str.toStringz(iconName), size)");
459 		}
460 		this(cast(GtkButton*) p);
461 	}
462 	
463 	/**
464 	 * Warning
465 	 * gtk_button_pressed has been deprecated since version 2.20 and should not be used in newly-written code. Use the "button-press-event" signal.
466 	 * Emits a "pressed" signal to the given GtkButton.
467 	 */
468 	public void pressed()
469 	{
470 		// void gtk_button_pressed (GtkButton *button);
471 		gtk_button_pressed(gtkButton);
472 	}
473 	
474 	/**
475 	 * Warning
476 	 * gtk_button_released has been deprecated since version 2.20 and should not be used in newly-written code. Use the "button-release-event" signal.
477 	 * Emits a "released" signal to the given GtkButton.
478 	 */
479 	public void released()
480 	{
481 		// void gtk_button_released (GtkButton *button);
482 		gtk_button_released(gtkButton);
483 	}
484 	
485 	/**
486 	 * Emits a "clicked" signal to the given GtkButton.
487 	 */
488 	public void clicked()
489 	{
490 		// void gtk_button_clicked (GtkButton *button);
491 		gtk_button_clicked(gtkButton);
492 	}
493 	
494 	/**
495 	 * Warning
496 	 * gtk_button_enter has been deprecated since version 2.20 and should not be used in newly-written code. Use the "enter-notify-event" signal.
497 	 * Emits a "enter" signal to the given GtkButton.
498 	 */
499 	public void enter()
500 	{
501 		// void gtk_button_enter (GtkButton *button);
502 		gtk_button_enter(gtkButton);
503 	}
504 	
505 	/**
506 	 * Warning
507 	 * gtk_button_leave has been deprecated since version 2.20 and should not be used in newly-written code. Use the "leave-notify-event" signal.
508 	 * Emits a "leave" signal to the given GtkButton.
509 	 */
510 	public void leave()
511 	{
512 		// void gtk_button_leave (GtkButton *button);
513 		gtk_button_leave(gtkButton);
514 	}
515 	
516 	/**
517 	 * Sets the relief style of the edges of the given GtkButton widget.
518 	 * Three styles exist, GTK_RELIEF_NORMAL, GTK_RELIEF_HALF, GTK_RELIEF_NONE.
519 	 * The default style is, as one can guess, GTK_RELIEF_NORMAL.
520 	 * Params:
521 	 * newstyle = The GtkReliefStyle as described above.
522 	 */
523 	public void setRelief(GtkReliefStyle newstyle)
524 	{
525 		// void gtk_button_set_relief (GtkButton *button,  GtkReliefStyle newstyle);
526 		gtk_button_set_relief(gtkButton, newstyle);
527 	}
528 	
529 	/**
530 	 * Returns the current relief style of the given GtkButton.
531 	 * Returns: The current GtkReliefStyle
532 	 */
533 	public GtkReliefStyle getRelief()
534 	{
535 		// GtkReliefStyle gtk_button_get_relief (GtkButton *button);
536 		return gtk_button_get_relief(gtkButton);
537 	}
538 	
539 	/**
540 	 * Fetches the text from the label of the button, as set by
541 	 * gtk_button_set_label(). If the label text has not
542 	 * been set the return value will be NULL. This will be the
543 	 * case if you create an empty button with gtk_button_new() to
544 	 * use as a container.
545 	 * Returns: The text of the label widget. This string is owned by the widget and must not be modified or freed.
546 	 */
547 	public string getLabel()
548 	{
549 		// const gchar * gtk_button_get_label (GtkButton *button);
550 		return Str.toString(gtk_button_get_label(gtkButton));
551 	}
552 	
553 	/**
554 	 * Sets the text of the label of the button to str. This text is
555 	 * also used to select the stock item if gtk_button_set_use_stock()
556 	 * is used.
557 	 * This will also clear any previously set labels.
558 	 * Params:
559 	 * label = a string
560 	 */
561 	public void setLabel(string label)
562 	{
563 		// void gtk_button_set_label (GtkButton *button,  const gchar *label);
564 		gtk_button_set_label(gtkButton, Str.toStringz(label));
565 	}
566 	
567 	/**
568 	 * Warning
569 	 * gtk_button_get_use_stock is deprecated and should not be used in newly-written code. 3.10
570 	 * Returns whether the button label is a stock item.
571 	 * Returns: TRUE if the button label is used to select a stock item instead of being used directly as the label text.
572 	 */
573 	public int getUseStock()
574 	{
575 		// gboolean gtk_button_get_use_stock (GtkButton *button);
576 		return gtk_button_get_use_stock(gtkButton);
577 	}
578 	
579 	/**
580 	 * Warning
581 	 * gtk_button_set_use_stock is deprecated and should not be used in newly-written code. 3.10
582 	 * If TRUE, the label set on the button is used as a
583 	 * stock id to select the stock item for the button.
584 	 * Params:
585 	 * useStock = TRUE if the button should use a stock item
586 	 */
587 	public void setUseStock(int useStock)
588 	{
589 		// void gtk_button_set_use_stock (GtkButton *button,  gboolean use_stock);
590 		gtk_button_set_use_stock(gtkButton, useStock);
591 	}
592 	
593 	/**
594 	 * Returns whether an embedded underline in the button label indicates a
595 	 * mnemonic. See gtk_button_set_use_underline().
596 	 * Returns: TRUE if an embedded underline in the button label indicates the mnemonic accelerator keys.
597 	 */
598 	public int getUseUnderline()
599 	{
600 		// gboolean gtk_button_get_use_underline (GtkButton *button);
601 		return gtk_button_get_use_underline(gtkButton);
602 	}
603 	
604 	/**
605 	 * If true, an underline in the text of the button label indicates
606 	 * the next character should be used for the mnemonic accelerator key.
607 	 * Params:
608 	 * useUnderline = TRUE if underlines in the text indicate mnemonics
609 	 */
610 	public void setUseUnderline(int useUnderline)
611 	{
612 		// void gtk_button_set_use_underline (GtkButton *button,  gboolean use_underline);
613 		gtk_button_set_use_underline(gtkButton, useUnderline);
614 	}
615 	
616 	/**
617 	 * Sets whether the button will grab focus when it is clicked with the mouse.
618 	 * Making mouse clicks not grab focus is useful in places like toolbars where
619 	 * you don't want the keyboard focus removed from the main area of the
620 	 * application.
621 	 * Since 2.4
622 	 * Params:
623 	 * focusOnClick = whether the button grabs focus when clicked with the mouse
624 	 */
625 	public void setFocusOnClick(int focusOnClick)
626 	{
627 		// void gtk_button_set_focus_on_click (GtkButton *button,  gboolean focus_on_click);
628 		gtk_button_set_focus_on_click(gtkButton, focusOnClick);
629 	}
630 	
631 	/**
632 	 * Returns whether the button grabs focus when it is clicked with the mouse.
633 	 * See gtk_button_set_focus_on_click().
634 	 * Since 2.4
635 	 * Returns: TRUE if the button grabs focus when it is clicked with the mouse.
636 	 */
637 	public int getFocusOnClick()
638 	{
639 		// gboolean gtk_button_get_focus_on_click (GtkButton *button);
640 		return gtk_button_get_focus_on_click(gtkButton);
641 	}
642 	
643 	/**
644 	 * Sets the alignment of the child. This property has no effect unless
645 	 * the child is a GtkMisc or a GtkAlignment.
646 	 * Since 2.4
647 	 * Params:
648 	 * xalign = the horizontal position of the child, 0.0 is left aligned,
649 	 * 1.0 is right aligned
650 	 * yalign = the vertical position of the child, 0.0 is top aligned,
651 	 * 1.0 is bottom aligned
652 	 */
653 	public void setAlignment(float xalign, float yalign)
654 	{
655 		// void gtk_button_set_alignment (GtkButton *button,  gfloat xalign,  gfloat yalign);
656 		gtk_button_set_alignment(gtkButton, xalign, yalign);
657 	}
658 	
659 	/**
660 	 * Gets the alignment of the child in the button.
661 	 * Since 2.4
662 	 * Params:
663 	 * xalign = return location for horizontal alignment. [out]
664 	 * yalign = return location for vertical alignment. [out]
665 	 */
666 	public void getAlignment(out float xalign, out float yalign)
667 	{
668 		// void gtk_button_get_alignment (GtkButton *button,  gfloat *xalign,  gfloat *yalign);
669 		gtk_button_get_alignment(gtkButton, &xalign, &yalign);
670 	}
671 	
672 	/**
673 	 * Set the image of button to the given widget. The image will be
674 	 * displayed if the label text is NULL or if
675 	 * "always-show-image" is TRUE. You don't have to call
676 	 * gtk_widget_show() on image yourself.
677 	 * Since 2.6
678 	 * Params:
679 	 * image = a widget to set as the image for the button
680 	 */
681 	public void setImage(Widget image)
682 	{
683 		// void gtk_button_set_image (GtkButton *button,  GtkWidget *image);
684 		gtk_button_set_image(gtkButton, (image is null) ? null : image.getWidgetStruct());
685 	}
686 	
687 	/**
688 	 * Gets the widget that is currenty set as the image of button.
689 	 * This may have been explicitly set by gtk_button_set_image()
690 	 * or constructed by gtk_button_new_from_stock().
691 	 * Since 2.6
692 	 * Returns: a GtkWidget or NULL in case there is no image. [transfer none]
693 	 */
694 	public Widget getImage()
695 	{
696 		// GtkWidget * gtk_button_get_image (GtkButton *button);
697 		auto p = gtk_button_get_image(gtkButton);
698 		
699 		if(p is null)
700 		{
701 			return null;
702 		}
703 		
704 		return ObjectG.getDObject!(Widget)(cast(GtkWidget*) p);
705 	}
706 	
707 	/**
708 	 * Sets the position of the image relative to the text
709 	 * inside the button.
710 	 * Since 2.10
711 	 * Params:
712 	 * position = the position
713 	 */
714 	public void setImagePosition(GtkPositionType position)
715 	{
716 		// void gtk_button_set_image_position (GtkButton *button,  GtkPositionType position);
717 		gtk_button_set_image_position(gtkButton, position);
718 	}
719 	
720 	/**
721 	 * Gets the position of the image relative to the text
722 	 * inside the button.
723 	 * Since 2.10
724 	 * Returns: the position
725 	 */
726 	public GtkPositionType getImagePosition()
727 	{
728 		// GtkPositionType gtk_button_get_image_position (GtkButton *button);
729 		return gtk_button_get_image_position(gtkButton);
730 	}
731 	
732 	/**
733 	 * If TRUE, the button will always show the image in addition to the
734 	 * label, if available.
735 	 * Use this property if the button would be useless or hard to use
736 	 * without the image.
737 	 * Params:
738 	 * alwaysShow = TRUE if the menuitem should always show the image
739 	 * Since 3.6
740 	 */
741 	public void setAlwaysShowImage(int alwaysShow)
742 	{
743 		// void gtk_button_set_always_show_image (GtkButton *button,  gboolean always_show);
744 		gtk_button_set_always_show_image(gtkButton, alwaysShow);
745 	}
746 	
747 	/**
748 	 * Returns whether the button will always show the image in addition
749 	 * to the label, if available.
750 	 * Returns: TRUE if the button will always show the image Since 3.6
751 	 */
752 	public int getAlwaysShowImage()
753 	{
754 		// gboolean gtk_button_get_always_show_image (GtkButton *button);
755 		return gtk_button_get_always_show_image(gtkButton);
756 	}
757 	
758 	/**
759 	 * Returns the button's event window if it is realized, NULL otherwise.
760 	 * This function should be rarely needed.
761 	 * Since 2.22
762 	 * Returns: button's event window. [transfer none]
763 	 */
764 	public Window getEventWindow()
765 	{
766 		// GdkWindow * gtk_button_get_event_window (GtkButton *button);
767 		auto p = gtk_button_get_event_window(gtkButton);
768 		
769 		if(p is null)
770 		{
771 			return null;
772 		}
773 		
774 		return ObjectG.getDObject!(Window)(cast(GdkWindow*) p);
775 	}
776 }