GtkWindow

A window which will likely contain the rest of the application.

Object Hierarchy

GObject
`-- GtkObject
       `-- GtkWidget
              `-- GtkContainer
                     `-- GtkBin
                            `-- GtkWindow

Direct Subclasses

Description

A window is the framework that contains the application. It provides a context for the other widgets that make up the application.

As a subclass of GtkBin a window may only have one child. To add more widgets to a window first add a widget which can accept more than one child like a GtkHBox or a GtkVBox. Then add the other widgets to the child container. Trying to add more than one child will produce a warning.

Example 156. Adding too many children.

<?php
// Create a new window.
$window = new GtkWindow();

// Add two buttons.
$window->add(new GtkButton('1'));
$window->add(new GtkButton('2'));

/*
Spits out:
Gtk-WARNING **: Attempting to add a widget with type GtkButton to 
a GtkWindow, but as a GtkBin subclass a GtkWindow can only 
contain one widget at a time; it already contains a widget 
of type GtkButton
*/
?>

GtkWindow is a top level widget. This means that it may not be added as a child of another widget. Trying to do so will produce a Gtk-WARNING.

Constructors

-- Creates a new GtkWindow instance.

Methods

activate_default()
  Send the activate signal to the default widget.
activate_focus()
  Activates the widget with the focus.
activate_key()
  Activate a keyboard shortcut in the window by hand.
add_accel_group()
  Associates an accel group with the window.
add_mnemonic()
  Adds a mnemonic to the window.
begin_move_drag()
  Begins to move a window.
begin_resize_drag()
  Begins resizing the window.
deiconify()
  Deiconifies (unminimizes) the window.
fullscreen()
  Sets the window to fullscreen mode.
get_accept_focus()
  If the window wants to be focusable or not.
get_decorated()
  Returns whether or not the window decorations are currently shown.
get_default_size()
  Returns the window's default size.
get_destroy_with_parent()
  Whether the window will be destroyed with its transient parent.
get_focus()
  Returns the widget that has the focus.
get_focus_on_map()
  If window should receive the input focus when mapped.
get_frame_dimensions()
  Returns the dimensions of the frame window for the toplevel.
get_gravity()
  Returns the window's gravity.
get_has_frame()
  Returns whether or not the window as a frame window outside its GdkWindow.
get_icon()
  Returns the icon used to represent the window.
get_icon_list()
  Returns the icons in the window's icon list.
get_icon_name()
  Returns the name of the themed icon for the window.
get_mnemonic_modifier()
  Returns the mnemonic modifier for the window.
get_modal()
  If the window is modal or not.
get_position()
  Returns the position of the window with respect to its gravity.
get_resizable()
  If the window can be resized by the user.
get_role()
  Returns the window's role.
get_size()
  Returns the height and width of the window.
get_skip_pager_hint()
  If a pager shall display the window.
get_skip_taskbar_hint()
  If the window shall be hidden from the task bar.
get_title()
  Returns the window title.
get_transient_for()
  Returns the transient parent for the window.
get_type_hint()
  Returns the type hint for the window.
has_toplevel_focus()
  Returns whether or not input focus is within the window.
iconify()
  Minimizes the window.
is_active()
  Returns whether or not input focus is within the window.
maximize()
  Maximizes the window.
move()
  Requests that the window be moved to the given position.
parse_geometry()
  Parses an X Window System geometry string.
present()
  Shows the window to the user.
propagate_key_event()
  Passes a key press or release event to the focus chain until it is handled.
remove_accel_group()
  Disassociates an accelerator group from the window.
remove_mnemonic()
  Removes a mnemonic from the window.
reshow_with_initial_size()
  Hides then reshows the window in its original position and with its original size.
resize()
  Resizes the window.
set_accept_focus()
  Sets whether or not the window will accept input focus.
set_auto_startup_notification()
  Turns startup notification on or off.
set_decorated()
  Turns the borders and title bar for the window on/off.
set_default()
  Sets the given widget as the default for the window.
set_default_icon()
  Sets a fallback icon for the window.
set_default_size()
  Sets the default size of the window.
set_destroy_with_parent()
  Sets whether or not the window should be destroyed with its transient parent.
set_focus()
  Sets the focus widget for the window.
set_focus_on_map()
  Sets whether or not the window manager should give the window focus when the window is mapped.
set_frame_dimensions()
  Sets the size of the frame border.
set_geometry_hints()
  Sets hints about how the window can be resized by the user.
set_gravity()
  Sets the window gravity.
set_has_frame()
  Sets whether or not the window will have a frame window around it.
set_icon()
  Sets the icon representing the window.
set_icon_from_file()
  Sets the icon for the window from a file.
set_icon_list()
  Sets a list of icons for the window.
set_icon_name()
  Sets the window icon from an named theme icon.
set_keep_above()
  Forces the window to remain on top of other windows on the screen.
set_keep_below()
  Forces the window to remain beneath other windows on the screen.
set_mnemonic_modifier()
  Sets the mnemonic modifier for the window.
set_modal()
  Sets whether or not the window is modal.
set_policy()
  DEPRECATED. Sets how the window handles size requests and user resize attempts.
set_position()
  Sets a new position constraint for the window.
set_resizable()
  Sets if the window may be resized by the user.
set_role()
  Sets the role for the window.
set_screen()
  Sets the screen on which the window is to be displayed.
set_skip_pager_hint()
  Hide the window from the pager or not.
set_skip_taskbar_hint()
  Set that the window shall be hidden from the task bar.
set_title()
  Sets the window title
set_transient_for()
  Sets the transient parent for the window.
set_type_hint()
  Sets a type hint for the window.
set_wmclass()
  Sets the window manager name and class hints for the window.
stick()
  Show the window on all desktops.
unfullscreen()
  Returns the window to its original size and location.
unmaximize()
  Returns the window to its original size and location.
unstick()
  Don't show the window on all desktops.
get_default_icon_list()
 
list_toplevels()
 
set_default_icon_from_file()
 
set_default_icon_list()
 
set_default_icon_name()
 
window_mnemonic_activate()
 

Fields

allow_grow:
  Whether or not the window is allowed to grow.
allow_shrink:
  Whether or not the window is allowed to shrink.
configure_notify_received:
  Whether or not a window resize configuration event is currently outstanding.
configure_request_count:
  The number of outstanding resize configuration requests.
decorated:
  Whether or not the window is currently decorated.
default_widget:
  The widget which will be activated by default.
destroy_with_parent:
  Whether or not the window will be destroyed with its parent window.
focus_widget:
  The widget that currently has keyboard focus.
frame:
  The frame window surrounding the window.
frame_bottom:
 
frame_left:
 
frame_right:
 
frame_top:
 
gravity:
  The gravity of the window.
group:
 
has_focus:
 
has_frame:
 
has_user_ref_count:
 
iconify_initially:
 
keys_changed_handler:
 
maximize_initially:
 
mnemonic_modifier:
 
modal:
  Whether or not the window is modal.
need_default_position:
 
need_default_size:
 
position:
 
stick_initially:
 
title:
  The title of the window.
transient_parent:
 
type:
  The window's type.
type_hint:
  A hint describing the window's type.
wm_role:
 
wmclass_class:
 
wmclass_name:
 

Signals

"activate-default"
 
"activate-focus"
 
"frame-event"
  Emitted when an event other than key-press, key-release, or a change in focus occurs on the window's frame.
"keys-changed"
  Emitted when a mnemonic accelerator is added, removed or changed or the mnemonic modifier is set.
"move-focus"
  Emitted when the user changes the window's focus widget.
"set-focus"
  Emitted when the window's focus widget is changed.