GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Gtk2::Window(3) User Contributed Perl Documentation Gtk2::Window(3)

Gtk2::Window - wrapper for GtkWindow

A Gtk2::Window is a top-level window displayed on the root window and interacting (or not) with the window manager. It can be an application's main window, a dialog, or a temporary such as a popup splash window.

The default action for a "delete-event" (normally from the window manager close button) is to destroy the window with "$window->destroy". In your main window you might want to exit the main loop when that happens.

    $toplevel->signal_connect (destroy => sub { Gtk2->main_quit });

If you install a handler for "delete-event" and return true, meaning "don't propagate", you can do something other than destroy the window. For example

    $toplevel->signal_connect (delete_event => sub {
       if (any_unsaved_documents()) {
         popup_ask_save_before_exit_dialog();
         return Gtk2::EVENT_STOP;  # don't go to default destroy
       } else {
         return Gtk2::EVENT_PROPAGATE;
       }
    });

In a dialog or secondary app window you might not want to destroy but instead just hide ready for later re-use.

    $dialog->signal_connect
      (delete_event => \&Gtk2::Widget::hide_on_delete);

The choice between destroying or hiding is normally just a matter of memory saved against the time to re-create, and how likely the dialog might be needed again. (However if you build windows with Glade it's not particularly easy to re-create them there, so you'll mostly want to just hide in that case.)

A hidden toplevel window is still in "Gtk2::Window->list_toplevels" and that's a good place to search for an existing window of a desired type to "$window->present" again.

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Container
                      +----Gtk2::Bin
                           +----Gtk2::Window

  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable

$type (Gtk2::WindowType)

Since: gtk+ 2.4

$setting (boolean)

Since: gtk+ 2.4

$event (Gtk2::Gdk::Event::Key)

Since: gtk+ 2.4

$accel_group (Gtk2::AccelGroup)

$xid (integer)

  • $keyval (integer)
  • $target (Gtk2::Widget)

$setting (boolean)

Since: gtk+ 2.2

  • $button (integer)
  • $root_x (integer)
  • $root_y (integer)
  • $timestamp (unsigned)

  • $edge (Gtk2::Gdk::WindowEdge)
  • $button (integer)
  • $root_x (integer)
  • $root_y (integer)
  • $timestamp (unsigned)

$setting (boolean)

$filename (localized file name)

May croak with a Glib::Error in $@ on failure.

Since: gtk+ 2.2

Gets the value set by $window->set_default_icon_list.

  • ... (list)
  • $pixbuf1 (Gtk2::Gdk::Pixbuf)

Gets the value set by "Gtk2::Window->set_default_icon_name".

Since: gtk+ 2.16

$name (string or undef)

Since: gtk+ 2.6

$icon (Gtk2::Gdk::Pixbuf)

Since: gtk+ 2.4

$default_widget (Gtk2::Widget or undef)

  • $width (integer)
  • $height (integer)

Since: gtk+ 2.14

Since: gtk+ 2.10

$setting (boolean)

Since: gtk+ 2.10

$setting (boolean)

Since: gtk+ 2.6

$setting (boolean)

Since: gtk+ 2.6

$focus (Gtk2::Widget or undef)

  • $left (integer)
  • $top (integer)
  • $right (integer)
  • $bottom (integer)

Since: gtk+ 2.2

  • $geometry_widget (Gtk2::Widget)
  • $geom_mask (Gtk2::Gdk::WindowHints) optional, usually inferred from $geometry
  • $geometry (scalar) Gtk2::Gdk::Geometry or hashref

See "Gtk2::Gdk::Window::set_geometry_hints" on the $geometry and $geom_mask arguments.

$gravity (Gtk2::Gdk::Gravity)

Since: gtk+ 2.10

$setting (boolean)

Since: gtk+ 2.22

Since: gtk+ 2.4

$filename (localized file name)

May croak with a Glib::Error in $@ on failure.

Since: gtk+ 2.2

Retrieves the list of icons set by set_icon_list().

... (list) of Gtk2::Gdk::Pixbuf's

Sets up the icon representing a Gtk2::Window. The icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts.

set_icon_list () allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is available in; that is, don't scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.

By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.

Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.

Since: gtk+ 2.6

$name (string)

Since: gtk+ 2.6

$icon (Gtk2::Gdk::Pixbuf or undef)

Since: gtk+ 2.4

$setting (boolean)

Since: gtk+ 2.4

$setting (boolean)

Since: gtk+ 2.4

Returns a list of all existing toplevel windows.

  • $keyval (integer)
  • $modifier (Gtk2::Gdk::ModifierType)

$modifier (Gtk2::Gdk::ModifierType)

Since: gtk+ 2.20

$setting (boolean)

Since: gtk+ 2.20

$modal (boolean)

  • $x (integer)
  • $y (integer)

Since: gtk+ 2.12

$opacity (double)

Since: gtk+ 2.12

$geometry (string)

$position (Gtk2::WindowPosition)

$timestamp (unsigned)

Since: gtk+ 2.8

$event (Gtk2::Gdk::Event::Key)

Since: gtk+ 2.4

$accel_group (Gtk2::AccelGroup)

$xid (integer)

  • $keyval (integer)
  • $target (Gtk2::Widget)

$resizable (boolean)

  • $width (integer)
  • $height (integer)

$role (string)

Since: gtk+ 2.2

$screen (Gtk2::Gdk::Screen)

Since: gtk+ 2.2

Since: gtk+ 2.2

$setting (boolean)

Since: gtk+ 2.2

Since: gtk+ 2.2

$setting (boolean)

Since: gtk+ 2.2

$startup_id (string)

Since: gtk+ 2.12

$title (string or undef)

$parent (Gtk2::Window or undef)

$hint (Gtk2::Gdk::WindowTypeHint)

Since: gtk+ 2.2

Since: gtk+ 2.8

$setting (boolean)

Since: gtk+ 2.8

Since: gtk+ 2.20

  • $wmclass_name (string)
  • $wmclass_class (string)

'accept-focus' (boolean : default true : readable / writable / private / static-nick / static-blurb)
TRUE if the window should receive the input focus.
'allow-grow' (boolean : default true : readable / writable / private / static-nick / static-blurb / deprecated)
If TRUE, users can expand the window beyond its minimum size
'allow-shrink' (boolean : default false : readable / writable / private / static-nick / static-blurb / deprecated)
If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the time a bad idea
'decorated' (boolean : default true : readable / writable / private / static-nick / static-blurb)
Whether the window should be decorated by the window manager
'default-height' (integer : default -1 : readable / writable / private / static-nick / static-blurb)
The default height of the window, used when initially showing the window
'default-width' (integer : default -1 : readable / writable / private / static-nick / static-blurb)
The default width of the window, used when initially showing the window
'deletable' (boolean : default true : readable / writable / private / static-nick / static-blurb)
Whether the window frame should have a close button
'destroy-with-parent' (boolean : default false : readable / writable / private / static-nick / static-blurb)
If this window should be destroyed when the parent is destroyed
'focus-on-map' (boolean : default true : readable / writable / private / static-nick / static-blurb)
TRUE if the window should receive the input focus when mapped.
'gravity' (Gtk2::Gdk::Gravity : default "north-west" : readable / writable / private / static-nick / static-blurb)
The window gravity of the window
'has-toplevel-focus' (boolean : default false : readable / private / static-nick / static-blurb)
Whether the input focus is within this GtkWindow
'icon' (Gtk2::Gdk::Pixbuf : default undef : readable / writable / private / static-nick / static-blurb)
Icon for this window
'icon-name' (string : default undef : readable / writable / private / static-nick / static-blurb)
Name of the themed icon for this window
'is-active' (boolean : default false : readable / private / static-nick / static-blurb)
Whether the toplevel is the current active window
'mnemonics-visible' (boolean : default true : readable / writable / private / static-nick / static-blurb)
Whether mnemonics are currently visible in this window
'modal' (boolean : default false : readable / writable / private / static-nick / static-blurb)
If TRUE, the window is modal (other windows are not usable while this one is up)
'opacity' (double : default 1 : readable / writable / private / static-nick / static-blurb)
The opacity of the window, from 0 to 1
'resizable' (boolean : default true : readable / writable / private / static-nick / static-blurb)
If TRUE, users can resize the window
'role' (string : default undef : readable / writable / private / static-nick / static-blurb)
Unique identifier for the window to be used when restoring a session
'screen' (Gtk2::Gdk::Screen : default undef : readable / writable / private / static-nick / static-blurb)
The screen where this window will be displayed
'skip-pager-hint' (boolean : default false : readable / writable / private / static-nick / static-blurb)
TRUE if the window should not be in the pager.
'skip-taskbar-hint' (boolean : default false : readable / writable / private / static-nick / static-blurb)
TRUE if the window should not be in the task bar.
'startup-id' (string : default undef : writable / private / static-nick / static-blurb)
Unique startup identifier for the window used by startup-notification
'title' (string : default undef : readable / writable / private / static-nick / static-blurb)
The title of the window
'transient-for' (Gtk2::Window : default undef : readable / writable / construct / private / static-nick / static-blurb)
The transient parent of the dialog
'type' (Gtk2::WindowType : default "toplevel" : readable / writable / construct-only / private / static-nick / static-blurb)
The type of the window
'type-hint' (Gtk2::Gdk::WindowTypeHint : default "normal" : readable / writable / private / static-nick / static-blurb)
Hint to help the desktop environment understand what kind of window this is and how to treat it.
'urgency-hint' (boolean : default false : readable / writable / private / static-nick / static-blurb)
TRUE if the window should be brought to the user's attention.
'window-position' (Gtk2::WindowPosition : default "none" : readable / writable / private / static-nick / static-blurb)
The initial position of the window

activate-default (Gtk2::Window)
activate-focus (Gtk2::Window)
boolean = frame-event (Gtk2::Window, Gtk2::Gdk::Event)
keys-changed (Gtk2::Window)
set-focus (Gtk2::Window, Gtk2::Widget)

  • 'north-west' / 'GDK_GRAVITY_NORTH_WEST'
  • 'north' / 'GDK_GRAVITY_NORTH'
  • 'north-east' / 'GDK_GRAVITY_NORTH_EAST'
  • 'west' / 'GDK_GRAVITY_WEST'
  • 'center' / 'GDK_GRAVITY_CENTER'
  • 'east' / 'GDK_GRAVITY_EAST'
  • 'south-west' / 'GDK_GRAVITY_SOUTH_WEST'
  • 'south' / 'GDK_GRAVITY_SOUTH'
  • 'south-east' / 'GDK_GRAVITY_SOUTH_EAST'
  • 'static' / 'GDK_GRAVITY_STATIC'

  • 'shift-mask' / 'GDK_SHIFT_MASK'
  • 'lock-mask' / 'GDK_LOCK_MASK'
  • 'control-mask' / 'GDK_CONTROL_MASK'
  • 'mod1-mask' / 'GDK_MOD1_MASK'
  • 'mod2-mask' / 'GDK_MOD2_MASK'
  • 'mod3-mask' / 'GDK_MOD3_MASK'
  • 'mod4-mask' / 'GDK_MOD4_MASK'
  • 'mod5-mask' / 'GDK_MOD5_MASK'
  • 'button1-mask' / 'GDK_BUTTON1_MASK'
  • 'button2-mask' / 'GDK_BUTTON2_MASK'
  • 'button3-mask' / 'GDK_BUTTON3_MASK'
  • 'button4-mask' / 'GDK_BUTTON4_MASK'
  • 'button5-mask' / 'GDK_BUTTON5_MASK'
  • 'super-mask' / 'GDK_SUPER_MASK'
  • 'hyper-mask' / 'GDK_HYPER_MASK'
  • 'meta-mask' / 'GDK_META_MASK'
  • 'release-mask' / 'GDK_RELEASE_MASK'
  • 'modifier-mask' / 'GDK_MODIFIER_MASK'

  • 'north-west' / 'GDK_WINDOW_EDGE_NORTH_WEST'
  • 'north' / 'GDK_WINDOW_EDGE_NORTH'
  • 'north-east' / 'GDK_WINDOW_EDGE_NORTH_EAST'
  • 'west' / 'GDK_WINDOW_EDGE_WEST'
  • 'east' / 'GDK_WINDOW_EDGE_EAST'
  • 'south-west' / 'GDK_WINDOW_EDGE_SOUTH_WEST'
  • 'south' / 'GDK_WINDOW_EDGE_SOUTH'
  • 'south-east' / 'GDK_WINDOW_EDGE_SOUTH_EAST'

  • 'pos' / 'GDK_HINT_POS'
  • 'min-size' / 'GDK_HINT_MIN_SIZE'
  • 'max-size' / 'GDK_HINT_MAX_SIZE'
  • 'base-size' / 'GDK_HINT_BASE_SIZE'
  • 'aspect' / 'GDK_HINT_ASPECT'
  • 'resize-inc' / 'GDK_HINT_RESIZE_INC'
  • 'win-gravity' / 'GDK_HINT_WIN_GRAVITY'
  • 'user-pos' / 'GDK_HINT_USER_POS'
  • 'user-size' / 'GDK_HINT_USER_SIZE'

  • 'normal' / 'GDK_WINDOW_TYPE_HINT_NORMAL'
  • 'dialog' / 'GDK_WINDOW_TYPE_HINT_DIALOG'
  • 'menu' / 'GDK_WINDOW_TYPE_HINT_MENU'
  • 'toolbar' / 'GDK_WINDOW_TYPE_HINT_TOOLBAR'
  • 'splashscreen' / 'GDK_WINDOW_TYPE_HINT_SPLASHSCREEN'
  • 'utility' / 'GDK_WINDOW_TYPE_HINT_UTILITY'
  • 'dock' / 'GDK_WINDOW_TYPE_HINT_DOCK'
  • 'desktop' / 'GDK_WINDOW_TYPE_HINT_DESKTOP'
  • 'dropdown-menu' / 'GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU'
  • 'popup-menu' / 'GDK_WINDOW_TYPE_HINT_POPUP_MENU'
  • 'tooltip' / 'GDK_WINDOW_TYPE_HINT_TOOLTIP'
  • 'notification' / 'GDK_WINDOW_TYPE_HINT_NOTIFICATION'
  • 'combo' / 'GDK_WINDOW_TYPE_HINT_COMBO'
  • 'dnd' / 'GDK_WINDOW_TYPE_HINT_DND'

  • 'none' / 'GTK_WIN_POS_NONE'
  • 'center' / 'GTK_WIN_POS_CENTER'
  • 'mouse' / 'GTK_WIN_POS_MOUSE'
  • 'center-always' / 'GTK_WIN_POS_CENTER_ALWAYS'
  • 'center-on-parent' / 'GTK_WIN_POS_CENTER_ON_PARENT'

  • 'toplevel' / 'GTK_WINDOW_TOPLEVEL'
  • 'popup' / 'GTK_WINDOW_POPUP'

Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.

2022-06-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.