Gtk2::Gdk::Window
wrapper for GdkWindow
- Provided by: libgtk2-perl-doc (Version: 2:1.2498-1)
- Source: libgtk2-perl
- Report a bug
wrapper for GdkWindow
"Gtk2::Gdk::Window" is a low-level window-system window. One of these is created when a widget is "realized".
As of Gtk 2.22 a window can only be created by "Gtk2::Gdk::Window->new()", "foreign_new()", etc. "Glib::Object::new()" doesn't work (segfaults on using the resulting window object). It's not possible to subclass "Gtk2::Gdk::Window" with Glib::Object::Subclass and the "Glib::Type" system, since only "gdk_window_new()" does the actual window creation, and that function always makes a "GdkWindow". (The Perl-Gtk "Gtk2::Gdk::Window->new()" wrapper ignores the class name argument.)
It may work to create a Perl level subclass and re-bless a "Gtk2::Gdk::Window->new()" into that. But like any such re-blessing it's not preserved when the object is returned from a Gtk function etc (that just gives the base Gtk class).
Glib::Object
+----Gtk2::Gdk::Drawable
+----Gtk2::Gdk::Window
Create and return a new window. parent can be undef to mean the root window of the default screen. attributes_ref is a hashref containing some of the following keys,
title string
event_mask Gtk2::Gdk::EventMask flags
x integer
y integer
width integer
height integer
wclass Gtk2::Gdk::WindowClass enum
visual Gtk2::Gdk::Visual
colormap Gtk2::Gdk::Colormap
window_type Gtk2::Gdk::WindowType enum
cursor Gtk2::Gdk::Cursor
wmclass_name string
wmclass_class string
override_redirect boolean (integer 0 or 1)
window_type is mandatory because it defaults to "root" but of course it's not possible to create a new root window. The other fields get default values zero, empty, unset, etc.
my $win = Gtk2::Gdk::Window->new
(undef, { window_type => 'toplevel,
wclass => 'GDK_INPUT_OUTPUT',
x => 0,
y => 0,
width => 200,
height => 100 });
Incidentally, the nicknames for wclass Gtk2::Gdk::WindowClass really are "output" for input-output and "only" for input-only. Those names are a bit odd, but that's what Gtk has. You can, as for any enum, give the full names like "GDK_INPUT_OUTPUT" if desired, for some clarity.
Since: gtk+ 2.22
Since: gtk+ 2.4
Returns window, a Gtk2::Gdk::Window and win_x and win_y, integers.
Since: gtk+ 2.22
Since: gtk+ 2.12
Since: gtk+ 2.10
Returns the list of children (Gtk2::Gdk::Window's) known to gdk.
Since: gtk+ 2.22
Since: gtk+ 2.12
Since: gtk+ 2.6
Since: gtk+ 2.22
Since: gtk+ 2.22
Since: gtk+ 2.22
Since: gtk+ 2.18
Since: gtk+ 2.22
Since: gtk+ 2.22
Only for offscreen "Gtk2::Gdk::Windows".
Since: gtk+ 2.18
Only for offscreen "Gtk2::Gdk::Windows".
Since: gtk+ 2.18
Since: gtk+ 2.6
Since: gtk+ 2.18
Since: gtk+ 2.18
Since: gtk+ 2.22
Since: gtk+ 2.6
Since: gtk+ 2.2
Since: gtk+ 2.2
Only useful for offscreen "Gtk2::Gdk::Windows".
Since: gtk+ 2.18
$geometry is either a "Gtk2::Gdk::Geometry" object, or a hashref with the following keys and values,
min_width integer \ 'min-size' mask
min_height integer /
max_width integer \ 'max-size' mask
max_height integer /
base_width integer \ 'base-size' mask
base_height integer /
width_inc integer \ 'resize-inc' mask
height_inc integer /
min_aspect float \ 'aspect' mask
max_aspect float /
win_gravity Gtk2::Gdk::Gravity enum, 'win-gravity' mask
Optional $geom_mask is which fields of $geometry are used. If $geometry is a hashref then $geom_mask defaults to the keys supplied in the hash, so for example
$win->set_geometry_hints ({ min_width => 20, min_height => 10});
If $geometry is a "Gtk2::Gdk::Geometry" object then you must give $geom_mask explicitly.
The 'pos', 'user-pos' and 'user-size' flags in $geom_mask have no data fields, so cannot be inferred from a $geometry hashref. If you want those flags you must pass $geom_mask explicitly.
Since: gtk+ 2.4
Since: gtk+ 2.22
Since: gtk+ 2.10
Since: gtk+ 2.10
Since: gtk+ 2.18
Since: gtk+ 2.22
Since: gtk+ 2.22
Since: gtk+ 2.4
Since: gtk+ 2.4
Since: gtk+ 2.2
Since: gtk+ 2.10
Since: gtk+ 2.22
Since: gtk+ 2.8
Since: gtk+ 2.8
Since: gtk+ 2.12
An alias for get_children
Only for offscreen "Gtk2::Gdk::Windows".
Since: gtk+ 2.18
Returns window_at_pointer, a Gtk2::Gdk::Window or undef, x and y, integers, and mask, a Gtk2::Gdk::ModifierType.
Depending on the value of format, the property value(s) can be:
+--------------------+------------------------------------+ | format | value | +--------------------+------------------------------------+ | Gtk2::Gdk::CHARS | a string | | Gtk2::Gdk::USHORTS | one or more unsigned short numbers | | Gtk2::Gdk::ULONGS | one or more unsigned long numbers | +--------------------+------------------------------------+
See property_change for an explanation of the meaning of format.
Since: gtk+ 2.14
Since: gtk+ 2.14
Since: gtk+ 2.18
Since: gtk+ 2.18
Since: gtk+ 2.2
Since: gtk+ 2.2
Since: gtk+ 2.12
Returns a list of top level windows (Gtk2::Gdk::Window's) known to gdk, on the default screen. A toplevel window is a child of the root window.
Since: gtk+ 2.10
Since: gtk+ 2.2
Since: gtk+ 2.8
Since: gtk+ 2.6
from-embedder, to-embedder and pick-embedded-child signals are for offscreen windows only.
from-embedder and to-embedder receive the x and y coordinates to translate, and must return the translated x and y coordinate.
Gtk2, Glib::Object, Gtk2::Gdk::Drawable
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.