DESCRIPTION
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).
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.
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.
$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.