GtkWindow
A window which will likely contain the rest of the application.
Object Hierarchy
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 153. 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.