|
NAMEGtk2::Window - wrapper for GtkWindowDESCRIPTIONA 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.Delete Event and DestroyThe 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. HIERARCHYGlib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Bin +----Gtk2::Window INTERFACESGlib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODSwidget = Gtk2::Window->new ($type=GTK_WINDOW_TOPLEVEL)
boolean = $window->get_accept_focusSince: gtk+ 2.4$window->set_accept_focus ($setting)
Since: gtk+ 2.4 boolean = $window->activate_defaultboolean = $window->activate_focusboolean = $window->activate_key ($event)
Since: gtk+ 2.4 $window->add_accel_group ($accel_group)
$window->add_embedded_xid ($xid)
$window->add_mnemonic ($keyval, $target)
Gtk2::Window->set_auto_startup_notification ($setting)
Since: gtk+ 2.2 $window->begin_move_drag ($button, $root_x, $root_y, $timestamp)
$window->begin_resize_drag ($edge, $button, $root_x, $root_y, $timestamp)
boolean = $window->get_decorated$window->set_decorated ($setting)
Gtk2::Window->set_default_icon_from_file ($filename)$window->set_default_icon_from_file ($filename)
May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.2 list = Gtk2::Window->get_default_icon_listGets the value set by $window->set_default_icon_list.$window->set_default_icon_list ($pixbuf1, ...)
string or undef = Gtk2::Window->get_default_icon_nameGets the value set by "Gtk2::Window->set_default_icon_name".Since: gtk+ 2.16 Gtk2::Window->set_default_icon_name ($name)
Since: gtk+ 2.6 Gtk2::Window->set_default_icon ($icon)
Since: gtk+ 2.4 $window->set_default ($default_widget)
(width, height) = $window->get_default_size$window->set_default_size ($width, $height)
widget or undef = $window->get_default_widgetSince: gtk+ 2.14$window->deiconifyboolean = $window->get_deletableSince: gtk+ 2.10$window->set_deletable ($setting)
Since: gtk+ 2.10 boolean = $window->get_destroy_with_parent$window->set_destroy_with_parent ($setting)
widget or undef = $window->get_focusboolean = $window->get_focus_on_mapSince: gtk+ 2.6$window->set_focus_on_map ($setting)
Since: gtk+ 2.6 $window->set_focus ($focus=undef)
(left, top, right, bottom) = $window->get_frame_dimensions$window->set_frame_dimensions ($left, $top, $right, $bottom)
$window->fullscreenSince: gtk+ 2.2$window->set_geometry_hints ($geometry_widget, $geometry)$window->set_geometry_hints ($geometry_widget, $geometry, $geom_mask)
See "Gtk2::Gdk::Window::set_geometry_hints" on the $geometry and $geom_mask arguments. gravity = $window->get_gravity$window->set_gravity ($gravity)
windowgroup or undef = $window->get_groupSince: gtk+ 2.10boolean = $window->get_has_frame$window->set_has_frame ($setting)
boolean = $window->has_groupSince: gtk+ 2.22boolean = $window->has_toplevel_focusSince: gtk+ 2.4$window->set_icon_from_file ($filename)
May croak with a Glib::Error in $@ on failure. Since: gtk+ 2.2 pixbuf or undef = $window->get_iconlist = $window->get_icon_listRetrieves the list of icons set by set_icon_list().$window->set_icon_list (...)
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. string or undef = $window->get_icon_nameSince: gtk+ 2.6$window->set_icon_name ($name)
Since: gtk+ 2.6 $window->set_icon ($icon)
$window->iconifyboolean = $window->is_activeSince: gtk+ 2.4$window->set_keep_above ($setting)
Since: gtk+ 2.4 $window->set_keep_below ($setting)
Since: gtk+ 2.4 list = Gtk2::Window->list_toplevelsReturns a list of all existing toplevel windows.$window->maximizeboolean = $window->mnemonic_activate ($keyval, $modifier)
modifiertype = $window->get_mnemonic_modifier$window->set_mnemonic_modifier ($modifier)
boolean = $window->get_mnemonics_visibleSince: gtk+ 2.20$window->set_mnemonics_visible ($setting)
Since: gtk+ 2.20 boolean = $window->get_modal$window->set_modal ($modal)
$window->move ($x, $y)
double = $window->get_opacitySince: gtk+ 2.12$window->set_opacity ($opacity)
Since: gtk+ 2.12 boolean = $window->parse_geometry ($geometry)
(root_x, root_y) = $window->get_position$window->set_position ($position)
$window->present$window->present_with_time ($timestamp)
Since: gtk+ 2.8 boolean = $window->propagate_key_event ($event)
Since: gtk+ 2.4 $window->remove_accel_group ($accel_group)
$window->remove_embedded_xid ($xid)
$window->remove_mnemonic ($keyval, $target)
$window->reshow_with_initial_sizeboolean = $window->get_resizable$window->set_resizable ($resizable)
$window->resize ($width, $height)
string = $window->get_role$window->set_role ($role)
screen = $window->get_screenSince: gtk+ 2.2$window->set_screen ($screen)
Since: gtk+ 2.2 (width, height) = $window->get_sizeboolean = $window->get_skip_pager_hintSince: gtk+ 2.2$window->set_skip_pager_hint ($setting)
Since: gtk+ 2.2 boolean = $window->get_skip_taskbar_hintSince: gtk+ 2.2$window->set_skip_taskbar_hint ($setting)
Since: gtk+ 2.2 $window->set_startup_id ($startup_id)
Since: gtk+ 2.12 $window->stickstring = $window->get_title$window->set_title ($title=undef)
window or undef = $window->get_transient_for$window->set_transient_for ($parent)
windowtypehint = $window->get_type_hint$window->set_type_hint ($hint)
$window->unfullscreenSince: gtk+ 2.2$window->unmaximize$window->unstickboolean = $window->get_urgency_hintSince: gtk+ 2.8$window->set_urgency_hint ($setting)
Since: gtk+ 2.8 windowtype = $window->get_window_typeSince: gtk+ 2.20$window->set_wmclass ($wmclass_name, $wmclass_class)
PROPERTIES
SIGNALS
ENUMS AND FLAGSenum Gtk2::Gdk::Gravity
flags Gtk2::Gdk::ModifierType
enum Gtk2::Gdk::WindowEdge
flags Gtk2::Gdk::WindowHints
enum Gtk2::Gdk::WindowTypeHint
enum Gtk2::WindowPosition
enum Gtk2::WindowType
SEE ALSOGtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::BinCOPYRIGHTCopyright (C) 2003-2011 by the gtk2-perl team.This software is licensed under the LGPL. See Gtk2 for a full notice.
Visit the GSP FreeBSD Man Page Interface. |