"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).
window = Gtk2::Gdk::Window->new ($parent,
$attributes_ref)
- $parent (Gtk2::Gdk::Window or undef)
- $attributes_ref (scalar)
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.
boolean = $window->get_accept_focus
Since: gtk+ 2.22
$window->set_accept_focus ($accept_focus)
- •
- $accept_focus (boolean)
Since: gtk+ 2.4
Returns window, a Gtk2::Gdk::Window and win_x and win_y,
integers.
$window->set_back_pixmap ($pixmap,
$parent_relative=0)
- $pixmap (Gtk2::Gdk::Pixmap or undef)
- $parent_relative (boolean)
$window->set_background ($color)
- •
- $color (Gtk2::Gdk::Color)
$window->begin_move_drag ($button, $root_x, $root_y,
$timestamp)
- $button (integer)
- $root_x (integer)
- $root_y (integer)
- $timestamp (unsigned)
$window->begin_paint_rect ($rectangle)
- •
- $rectangle (Gtk2::Gdk::Rectangle)
$window->begin_paint_region ($region)
- •
- $region (Gtk2::Gdk::Region)
$window->begin_resize_drag ($edge, $button, $root_x,
$root_y, $timestamp)
- $edge (Gtk2::Gdk::WindowEdge)
- $button (integer)
- $root_x (integer)
- $root_y (integer)
- $timestamp (unsigned)
list = $window->get_children
Returns the list of children (Gtk2::Gdk::Window's) known to
gdk.
$window->clear_area ($x, $y, $width, $height)
- $x (integer)
- $y (integer)
- $width (integer)
- $height (integer)
$window->clear_area_e ($x, $y, $width, $height)
- $x (integer)
- $y (integer)
- $width (integer)
- $height (integer)
boolean = $window->get_composited
Since: gtk+ 2.22
$window->set_composited ($composited)
- •
- $composited (boolean)
Since: gtk+ 2.12
(x, y) = $window->coords_from_parent ($parent_x,
$parent_y)
- $parent_x (double)
- $parent_y (double)
Since: gtk+ 2.22
- $content (Cairo::Content)
- $width (integer)
- $height (integer)
Since: gtk+ 2.22
$window->set_cursor ($cursor)
- •
- $cursor (Gtk2::Gdk::Cursor or undef)
Gtk2::Gdk::Window->set_debug_updates ($enable)
$window->set_debug_updates ($enable)
- •
- $enable (boolean)
list = $window->get_decorations
$window->set_decorations ($decorations)
- •
- $decorations (Gtk2::Gdk::WMDecoration)
window = $window->get_effective_parent
Since: gtk+ 2.22
window = $window->get_effective_toplevel
Since: gtk+ 2.22
Only for offscreen
"Gtk2::Gdk::Windows".
Since: gtk+ 2.18
- •
- $embedder (Gtk2::Gdk::Window)
Only for offscreen
"Gtk2::Gdk::Windows".
Since: gtk+ 2.18
boolean = $window->ensure_native
Since: gtk+ 2.18
$window->set_events ($event_mask)
- •
- $event_mask (Gtk2::Gdk::EventMask)
$window->focus ($timestamp)
- •
- $timestamp (unsigned)
boolean = $window->get_focus_on_map
Since: gtk+ 2.22
$window->set_focus_on_map ($focus_on_map)
- •
- $focus_on_map (boolean)
Since: gtk+ 2.6
window = Gtk2::Gdk::Window->foreign_new ($anid)
- •
- $anid (Gtk2::Gdk::NativeWindow)
window = Gtk2::Gdk::Window->foreign_new_for_display
($display, $anid)
- $display (Gtk2::Gdk::Display)
- $anid (Gtk2::Gdk::NativeWindow)
Since: gtk+ 2.2
$window->set_functions ($functions)
- •
- $functions (Gtk2::Gdk::WMFunction)
Only useful for offscreen
"Gtk2::Gdk::Windows".
Since: gtk+ 2.18
$window->set_geometry_hints ($geometry)
$window->set_geometry_hints ($geometry,
$geom_mask)
- $geom_mask (Gtk2::Gdk::WindowHints) optional,
usually inferred from
$geometry
- $geometry (scalar) Gtk2::Gdk::Geometry or
hashref
$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.
window = $window->get_group
Since: gtk+ 2.4
$window->set_group ($leader)
- •
- $leader (Gtk2::Gdk::Window or undef)
boolean = $window->has_native
Since: gtk+ 2.22
$window->set_icon_list (...)
- •
- ... (list) of GdkPixbuf's
$window->set_icon_name ($name)
- •
- $name (string or undef)
$window->set_icon ($icon_window, $pixmap, $mask)
- $icon_window (Gtk2::Gdk::Window or undef)
- $pixmap (Gtk2::Gdk::Pixmap or undef)
- $mask (Gtk2::Gdk::Bitmap or undef)
$window->input_shape_combine_mask ($mask, $x, $y)
- $mask (Gtk2::Gdk::Bitmap or undef)
- $x (integer)
- $y (integer)
Since: gtk+ 2.10
$window->input_shape_combine_region ($shape, $offset_x,
$offset_y)
- $shape (Gtk2::Gdk::Region or undef)
- $offset_x (integer)
- $offset_y (integer)
Since: gtk+ 2.10
list = $window->get_internal_paint_info
$window->invalidate_maybe_recurse ($region, $func,
$data=undef)
- $region (Gtk2::Gdk::Region)
- $func (scalar)
- $data (scalar)
$window->invalidate_rect ($rectangle,
$invalidate_children)
- $rectangle (Gtk2::Gdk::Rectangle or undef)
- $invalidate_children (boolean)
$window->invalidate_region ($region,
$invalidate_children)
- $region (Gtk2::Gdk::Region)
- $invalidate_children (boolean)
boolean = $window->is_destroyed
Since: gtk+ 2.18
boolean = $window->is_input_only
Since: gtk+ 2.22
boolean = $window->is_shaped
Since: gtk+ 2.22
boolean = $window->is_viewable
boolean = $window->is_visible
$window->set_keep_above ($setting)
- •
- $setting (boolean)
Since: gtk+ 2.4
$window->set_keep_below ($setting)
- •
- $setting (boolean)
Since: gtk+ 2.4
window = Gtk2::Gdk::Window->lookup ($anid)
- •
- $anid (Gtk2::Gdk::NativeWindow)
window = Gtk2::Gdk::Window->lookup_for_display
($display, $anid)
- $display (Gtk2::Gdk::Display)
- $anid (Gtk2::Gdk::NativeWindow)
Since: gtk+ 2.2
boolean = $window->get_modal_hint
Since: gtk+ 2.22
$window->set_modal_hint ($modal)
- •
- $modal (boolean)
$window->move ($x, $y)
- $x (integer)
- $y (integer)
$window->move_region ($region, $dx, $dy)
- $region (Gtk2::Gdk::Region)
- $dx (integer)
- $dy (integer)
Since: gtk+ 2.8
$window->move_resize ($x, $y, $width, $height)
- $x (integer)
- $y (integer)
- $width (integer)
- $height (integer)
$window->set_opacity ($opacity)
- •
- $opacity (double)
Since: gtk+ 2.12
(x, y) = $window->get_origin
$window->set_override_redirect
($override_redirect)
- •
- $override_redirect (boolean)
window = $window->get_parent
list = $window->peek_children
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.
(x, y) = $window->get_position
$window->process_updates ($update_children)
- •
- $update_children (boolean)
$window->property_change ($property, $type, $format,
$mode, ...)
- $property (Gtk2::Gdk::Atom)
- $type (Gtk2::Gdk::Atom)
- $format (integer)
- $mode (Gtk2::Gdk::PropMode)
- ... (list) property value(s)
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 |
+--------------------+------------------------------------+
$window->property_delete ($property)
- •
- $property (Gtk2::Gdk::Atom)
- $property (Gtk2::Gdk::Atom)
- $type (Gtk2::Gdk::Atom)
- $offset (unsigned)
- $length (unsigned)
- $pdelete (integer)
See property_change for an explanation of the meaning of
format.
$window->redirect_to_drawable ($drawable, $src_x,
$src_y, $dest_x, $dest_y, $width, $height)
- $drawable (Gtk2::Gdk::Drawable)
- $src_x (integer)
- $src_y (integer)
- $dest_x (integer)
- $dest_y (integer)
- $width (integer)
- $height (integer)
Since: gtk+ 2.14
$window->reparent ($new_parent, $x, $y)
- $new_parent (Gtk2::Gdk::Window)
- $x (integer)
- $y (integer)
$window->resize ($width, $height)
- $width (integer)
- $height (integer)
$window->restack ($sibling, $above)
- $sibling (Gtk2::Gdk::Window or undef)
- $above (boolean)
Since: gtk+ 2.18
$window->set_role ($role)
- •
- $role (string)
- $x (integer)
- $y (integer)
Since: gtk+ 2.18
(x, y) = $window->get_root_origin
$window->scroll ($dx, $dy)
- $dx (integer)
- $dy (integer)
$window->shape_combine_mask ($mask, $x, $y)
- $mask (Gtk2::Gdk::Bitmap or undef)
- $x (integer)
- $y (integer)
$window->shape_combine_region ($shape_region,
$offset_x, $offset_y)
- $shape_region (Gtk2::Gdk::Region or undef)
- $offset_x (integer)
- $offset_y (integer)
$window->set_skip_pager_hint ($skips_pager)
- •
- $skips_pager (boolean)
Since: gtk+ 2.2
$window->set_skip_taskbar_hint ($skips_taskbar)
- •
- $skips_taskbar (boolean)
Since: gtk+ 2.2
$window->set_startup_id ($startup_id)
- •
- $startup_id (string)
Since: gtk+ 2.12
boolean = $window->set_static_gravities
($use_static)
- •
- $use_static (boolean)
$window->set_title ($title)
- •
- $title (string)
window = $window->get_toplevel
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.
$window->set_transient_for ($parent)
- •
- $parent (Gtk2::Gdk::Window)
$window->set_type_hint ($hint)
- •
- $hint (Gtk2::Gdk::WindowTypeHint)
$window->set_urgency_hint ($urgent)
- •
- $urgent (boolean)
Since: gtk+ 2.8
$window->set_user_data ($user_data)
- •
- $user_data (unsigned)
$window->set_user_time ($timestamp)
- •
- $timestamp (unsigned)
Since: gtk+ 2.6