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 module gtk.TearoffMenuItem;
26 
27 private import glib.ConstructionException;
28 private import gobject.ObjectG;
29 private import gtk.MenuItem;
30 private import gtk.Widget;
31 private import gtkc.gtk;
32 public  import gtkc.gtktypes;
33 
34 
35 /**
36  * A #GtkTearoffMenuItem is a special #GtkMenuItem which is used to
37  * tear off and reattach its menu.
38  * 
39  * When its menu is shown normally, the #GtkTearoffMenuItem is drawn as a
40  * dotted line indicating that the menu can be torn off.  Activating it
41  * causes its menu to be torn off and displayed in its own window
42  * as a tearoff menu.
43  * 
44  * When its menu is shown as a tearoff menu, the #GtkTearoffMenuItem is drawn
45  * as a dotted line which has a left pointing arrow graphic indicating that
46  * the tearoff menu can be reattached.  Activating it will erase the tearoff
47  * menu window.
48  * 
49  * > #GtkTearoffMenuItem is deprecated and should not be used in newly
50  * > written code. Menus are not meant to be torn around.
51  */
52 public class TearoffMenuItem : MenuItem
53 {
54 	/** the main Gtk struct */
55 	protected GtkTearoffMenuItem* gtkTearoffMenuItem;
56 
57 	/** Get the main Gtk struct */
58 	public GtkTearoffMenuItem* getTearoffMenuItemStruct()
59 	{
60 		return gtkTearoffMenuItem;
61 	}
62 
63 	/** the main Gtk struct as a void* */
64 	protected override void* getStruct()
65 	{
66 		return cast(void*)gtkTearoffMenuItem;
67 	}
68 
69 	protected override void setStruct(GObject* obj)
70 	{
71 		gtkTearoffMenuItem = cast(GtkTearoffMenuItem*)obj;
72 		super.setStruct(obj);
73 	}
74 
75 	/**
76 	 * Sets our main struct and passes it to the parent class.
77 	 */
78 	public this (GtkTearoffMenuItem* gtkTearoffMenuItem, bool ownedRef = false)
79 	{
80 		this.gtkTearoffMenuItem = gtkTearoffMenuItem;
81 		super(cast(GtkMenuItem*)gtkTearoffMenuItem, ownedRef);
82 	}
83 
84 	/**
85 	 */
86 
87 	public static GType getType()
88 	{
89 		return gtk_tearoff_menu_item_get_type();
90 	}
91 
92 	/**
93 	 * Creates a new #GtkTearoffMenuItem.
94 	 *
95 	 * Deprecated: #GtkTearoffMenuItem is deprecated and should not be
96 	 * used in newly written code.
97 	 *
98 	 * Return: a new #GtkTearoffMenuItem.
99 	 *
100 	 * Throws: ConstructionException GTK+ fails to create the object.
101 	 */
102 	public this()
103 	{
104 		auto p = gtk_tearoff_menu_item_new();
105 		
106 		if(p is null)
107 		{
108 			throw new ConstructionException("null returned by new");
109 		}
110 		
111 		this(cast(GtkTearoffMenuItem*) p);
112 	}
113 }