Debian Codegraph @

gtk/src/fixed.hg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <gtkmm/container.h>
18 _DEFS(gtkmm,gtk)
19 _PINCLUDE(gtkmm/private/container_p.h)
20
21 namespace Gtk
22 {
23
24 /** A container which allows you to position widgets at fixed coordinates.
25 *
26 * The Gtk::Fixed widget is a container which can place child widgets at fixed positions and with fixed sizes, given in pixels. It performs no automatic layout management.
27 * For most applications, you should not use this container, because it will result in truncated text, overlapping widgets, and other display bugs:
28 * - Themes may change widget sizes.
29 * - Fonts other than the one you used to write the app will of course change the size of widgets containing text; keep in mind that users may use a larger font because of difficulty reading the default, or they may be using Windows or the framebuffer port of GTK+, where different fonts are available.
30 * - Translation of text into other languages changes its size. Also, display of non-English text will use a different font in many cases.
31 * In addition, the fixed widget can't properly be mirrored in right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+ will flip the interface to put labels to the right of the thing they label, but it can't do that with Gtk::Fixed. So your application will not be usable in right-to-left languages.
32 * Finally, fixed positioning makes it kind of annoying to add/remove GUI elements, since you have to reposition all the other elements. This is a long-term maintenance problem for your application.
33 * If you know none of these things are an issue for your application, and prefer the simplicity of Gtk::Fixed, by all means use the widget. But you should be aware of the tradeoffs.
34 *
35 * @ingroup Widgets
36 * @ingroup Containers
37 */
38 class GTKMM_API Fixed : public Container
39 {
40 _CLASS_GTKOBJECT(Fixed,GtkFixed,GTK_FIXED,Gtk::Container,GtkContainer,,,GTKMM_API)
41 public:
42 _CTOR_DEFAULT
43
44 _WRAP_METHOD(void put(Widget& widget, int x, int y), gtk_fixed_put)
45 _WRAP_METHOD(void move(Widget& widget, int x, int y), gtk_fixed_move)
46
47 _WRAP_CHILD_PROPERTY("x", int)
48 _WRAP_CHILD_PROPERTY("y", int)
49 };
50
51 } //namespace Gtk