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