alternative to assert
[gtkD.git] / gtkD / src / gtk / Fixed.d
blob41871ce0aaf3946c5426a3d53c02d57325245de9
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 = GtkFixed.html
26 * outPack = gtk
27 * outFile = Fixed
28 * strct = GtkFixed
29 * realStrct=
30 * ctorStrct=
31 * clss = Fixed
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_fixed_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - gtk.Widget
46 * structWrap:
47 * - GtkWidget* -> Widget
48 * module aliases:
49 * local aliases:
52 module gtk.Fixed;
54 version(noAssert)
56 version(Tango)
58 import tango.io.Stdout; // use the tango loging?
62 private import gtkc.gtktypes;
64 private import gtkc.gtk;
67 private import gtk.Widget;
72 /**
73 * Description
74 * The GtkFixed widget is a container which can place child widgets at fixed
75 * positions and with fixed sizes, given in pixels. GtkFixed performs no
76 * automatic layout management.
77 * For most applications, you should not use this container! It keeps
78 * you from having to learn about the other GTK+ containers, but it
79 * results in broken applications.
80 * With GtkFixed, the following things will result in truncated text,
81 * overlapping widgets, and other display bugs:
82 * Themes, which may change widget sizes.
83 * Fonts other than the one you used to write the app will of
84 * course change the size of widgets containing text; keep in mind that
85 * users may use a larger font because of difficulty reading the default,
86 * or they may be using Windows or the framebuffer port of GTK+, where
87 * different fonts are available.
88 * Translation of text into other languages changes its size. Also,
89 * display of non-English text will use a different font in many cases.
90 * In addition, the fixed widget can't properly be mirrored in
91 * right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
92 * will flip the interface to put labels to the right of the thing they
93 * label, but it can't do that with GtkFixed. So your application will
94 * not be usable in right-to-left languages.
95 * Finally, fixed positioning makes it kind of annoying to add/remove GUI
96 * elements, since you have to reposition all the other elements. This is
97 * a long-term maintenance problem for your application.
98 * If you know none of these things are an issue for your application,
99 * and prefer the simplicity of GtkFixed, by all means use the
100 * widget. But you should be aware of the tradeoffs.
102 private import gtk.Container;
103 public class Fixed : Container
106 /** the main Gtk struct */
107 protected GtkFixed* gtkFixed;
110 public GtkFixed* getFixedStruct()
112 return gtkFixed;
116 /** the main Gtk struct as a void* */
117 protected void* getStruct()
119 return cast(void*)gtkFixed;
123 * Sets our main struct and passes it to the parent class
125 public this (GtkFixed* gtkFixed)
127 version(noAssert)
129 if ( gtkFixed is null )
131 int zero = 0;
132 version(Tango)
134 Stdout("struct gtkFixed is null on constructor").newline;
136 else
138 printf("struct gtkFixed is null on constructor");
140 zero = zero / zero;
143 else
145 assert(gtkFixed !is null, "struct gtkFixed is null on constructor");
147 super(cast(GtkContainer*)gtkFixed);
148 this.gtkFixed = gtkFixed;
157 * Creates a new GtkFixed.
158 * Returns:
159 * a new GtkFixed.
161 public this ()
163 // GtkWidget* gtk_fixed_new (void);
164 this(cast(GtkFixed*)gtk_fixed_new() );
168 * Adds a widget to a GtkFixed container at the given position.
169 * fixed:
170 * a GtkFixed.
171 * widget:
172 * the widget to add.
173 * x:
174 * the horizontal position to place the widget at.
175 * y:
176 * the vertical position to place the widget at.
178 public void put(Widget widget, int x, int y)
180 // void gtk_fixed_put (GtkFixed *fixed, GtkWidget *widget, gint x, gint y);
181 gtk_fixed_put(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y);
185 * Moves a child of a GtkFixed container to the given position.
186 * fixed:
187 * a GtkFixed.
188 * widget:
189 * the child widget.
190 * x:
191 * the horizontal position to move the widget to.
192 * y:
193 * the vertical position to move the widget to.
195 public void move(Widget widget, int x, int y)
197 // void gtk_fixed_move (GtkFixed *fixed, GtkWidget *widget, gint x, gint y);
198 gtk_fixed_move(gtkFixed, (widget is null) ? null : widget.getWidgetStruct(), x, y);
202 * Gets whether the GtkFixed has its own GdkWindow.
203 * See gdk_fixed_set_has_window().
204 * fixed:
205 * a GtkWidget
206 * Returns:
207 * TRUE if fixed has its own window.
209 public int getHasWindow()
211 // gboolean gtk_fixed_get_has_window (GtkFixed *fixed);
212 return gtk_fixed_get_has_window(gtkFixed);
216 * Sets whether a GtkFixed widget is created with a separate
217 * GdkWindow for widget->window or not. (By default, it will be
218 * created with no separate GdkWindow). This function must be called
219 * while the GtkFixed is not realized, for instance, immediately after the
220 * window is created.
221 * This function was added to provide an easy migration path for
222 * older applications which may expect GtkFixed to have a separate window.
223 * fixed:
224 * a GtkFixed
225 * has_window:
226 * TRUE if a separate window should be created
227 * Child Property Details
228 * The "x" child property
229 * "x" gint : Read / Write
230 * X position of child widget.
231 * Default value: 0
233 public void setHasWindow(int hasWindow)
235 // void gtk_fixed_set_has_window (GtkFixed *fixed, gboolean has_window);
236 gtk_fixed_set_has_window(gtkFixed, hasWindow);