Package: gtk

Class gtk-window

Superclasses

gtk-bin, gtk-container, gtk-widget, gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

type
The type property of type gtk-window-type (Read / Write / Construct)
The type of the window.
Default value: :toplevel
accept-focus
The accept-focus property of type :boolean (Read / Write)
Whether the window should receive the input focus.
Default value: true
application
The application property of type gtk-application (Read / Write)
The application associated with the window. The application will be kept alive for at least as long as it has any windows associated with it. See the g-application-hold function for a way to keep it alive without windows. Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it by setting the application property to nil.
attached-to
The attached-to property of type gtk-widget (Read / Write / Construct)
The widget to which this window is attached. Examples of places where specifying this relation is useful are for instance a gtk-menu widget created by a gtk-combo-box widget, a completion popup window created by a gtk-entry widget or a typeahead search entry created by a gtk-tree-view widget.
decorated
The decorated property of type :boolean (Read / Write)
Whether the window should be decorated by the window manager.
Default value: true
default-height
The default-height property of type :int (Read / Write)
The default height of the window, used when initially showing the window.
Allowed values: >= -1
Default value: -1
default-width
The default-width property of type :int (Read / Write)
The default width of the window, used when initially showing the window.
Allowed values: >= -1
Default value: -1
deletable
The deletable property of type :boolean (Read / Write)
Whether the window frame should have a Close button.
Default value: true
destroy-with-parent
The destroy-with-parent property of type :boolean (Read / Write)
If this window should be destroyed when the parent is destroyed.
Default value: false
focus-on-map
The focus-on-map property of type :boolean (Read / Write)
Whether the window should receive the input focus when mapped.
Default value: true
focus-visible
The focus-visible property of type :boolean (Read / Write)
Whether "focus rectangles" are currently visible in this window. This property is maintained by GTK based on the gtk-visible-focus setting and user input and should not be set by applications.
Default value: true
gravity
The gravity property of type gdk-gravity (Read / Write)
The window gravity of the window. See the gtk-window-move function and the gdk-gravity enumeration for more details about window gravity.
Default value: :north-west
has-resize-grip
The has-resize-grip property of type :boolean (Read / Write)
Whether the window has a corner resize grip.
Warning: The has-resize-grip property has been deprecated since version 3.14 and should not be used in newly written code. Resize grips have been removed.
Default value: false
has-toplevel-focus
The has-toplevel-focus property of type :boolean (Read)
Whether the input focus is within the window.
Default value: false
hide-titlebar-when-maximized
The hide-titlebar-when-maximized property of type :boolean (Read / Write)
Whether the titlebar should be hidden during maximization.
Default value: false
icon
The icon property of type gdk-pixbuf (Read / Write)
Icon for the window.
icon-name
The icon-name property of type :string (Read / Write)
Specifies the name of the themed icon to use as the window icon. See the gtk-icon-theme documentation for more details.
Default value: nil
is-active
The is-active property of type :boolean (Read)
Whether the toplevel is the current active window.
Default value: false
is-maximized
The is-maximized property of type :boolean (Read)
Whether the window is maximized.
Default value: false
mnemonics-visible
The mnemonics-visible property of type :boolean (Read / Write)
Whether mnemonics are currently visible in the window. This property is maintained by GTK based on the gtk-auto-mnemonics setting and user input, and should not be set by applications.
Default value: true
modal
The modal property of type :boolean (Read / Write)
If true, the window is modal. Other windows are not usable while this one is up.
Default value: false
opacity
The opacity property of type :double (Read / Write)
The requested opacity of the window.
Allowed values: [0.0,1.0]
Default value: 1.0
resizable
The resizable property of type :boolean (Read / Write)
If true, users can resize the window.
Default value: true
resize-grip-visible
The resize-grip-visible property of type :boolean (Read)
Whether a corner resize grip is currently shown.
Warning: The resize-grip-visible property has been deprecated since version 3.14 and should not be used in newly written code. Resize grips have been removed.
Default value: false
role
The role property of type :string (Read / Write)
Unique identifier for the window to be used when restoring a session.
Default value: nil
screen
The screen property of type gdk-screen (Read / Write)
The screen where this window will be displayed.
skip-pager-hint
The skip-pager-hint property of type :boolean (Read / Write)
True if the window should not be in the pager.
Default value: false
skip-taskbar-hint
The skip-taskbar-hint property of type :boolean (Read / Write)
True if the window should not be in the task bar.
Default value: false
startup-id
The startup-id property of type :string (Write)
A write-only property for setting the startup notification identifier of the window.
Default value: nil
title
The title property of type :string (Read / Write)
The title of the window.
Default value: nil
transient-for
The transient-for property of type gtk-window (Read / Write / Construct)
The transient parent of the window.
type-hint
The type-hint property of type gdk-window-type-hint (Read / Write)
Hint to help the desktop environment understand what kind of window this is and how to treat it.
Default value: :normal
urgency-hint
The urgency-hint property of type :boolean (Read / Write)
True if the window should be brought to the attention of the user.
Default value: false
window-position
The window-position property of type gtk-window-position (Read / Write)
The initial position of the window.
Default value: :none

Details

A gtk-window widget is a toplevel window which can contain other widgets.



Windows normally have decorations that are under the control of the windowing system and allow the user to manipulate the window, e.g. to resize it, move it, or close it.

GtkWindow as GtkBuildable

The gtk-window implementation of the gtk-buildable interface supports a custom <accel-groups> element, which supports any number of <group> elements representing the gtk-accel-group objects you want to add to your window. This is synonymous with the gtk-window-add-accel-group function.

Example: A UI definition fragment with accelerator groups
 <object class="GtkWindow">
   <accel-groups>
     <group name="accelgroup1"/>
   </accel-groups>
 </object>
 <!-- -->
   ...
 <!-- -->
 <object class="GtkAccelGroup" id="accelgroup1"/>    
The gtk-window implementation of the gtk-buildable interface supports setting a child as the titlebar by specifying "titlebar" as the "type" attribute of a <child> element.

CSS nodes

 window.background
 ├── decoration
 ├── <titlebar child>.titlebar [.default-decoration]
 ╰── <child>    
The gtk-window implementation has a main CSS node with name window and .background style class, and a subnode with name decoration.

Style classes that are typically used with the main CSS node are .csd, when client-side decorations are in use, .solid-csd, for client-side decorations without invisible borders, .ssd, used by mutter when rendering server-side decorations. The gtk-window implementation also represents window states with the following style classes on the main node: .tiled, .maximized, .fullscreen. Specialized types of window often add their own discriminating style classes, such as .popup or .tooltip.

The gtk-window implementation adds the .titlebar and .default-decoration style classes to the widget that is added as a titlebar child.

Style Property Details

decoration-button-layout
The decoration-button-layout style property of type :string (Read)
Decorated button layout.
Default value: "menu:close"
decoration-resize-handle
The decoration-resize-handle style property of type :int (Read / Write)
Decoration resize handle size.
Allowed values: >= 0
Default value: 20

Signal Details

The "activate-default" signal
 lambda (window)    :action      
The signal is a keybinding signal which gets emitted when the user activates the default widget of the window.
window
The gtk-window widget which received the signal.
The "activate-focus" signal
 lambda (window)    :action      
The signal is a keybinding signal which gets emitted when the user activates the currently focused widget of the window.
window
The gtk-window widget which received the signal.
The "enable-debugging" signal
 lambda (window toggle)    :action      
The signal is a keybinding signal which gets emitted when the user enables or disables interactive debugging. When the toggle argument is true, interactive debugging is toggled on or off, when it is false, the debugger will be pointed at the widget under the pointer. The default bindings for this signal are the Ctrl-Shift-I and Ctrl-Shift-D keys.
window
The gtk-window widget on which the signal is emitted.
toggle
A boolean which toggles the debugger.
Returns
A boolean which is true if the key binding was handled.
The "keys-changed" signal
 lambda (window)    :run-first      
The signal gets emitted when the set of accelerators or mnemonics that are associated with the window changes.
window
The gtk-window widget which received the signal.
The "set-focus" signal
 lambda (window widget)    :run-last      
The signal is emitted whenever the currently focused widget in this window changes.
window
The gtk-window widget which received the signal.
widget
The newly focused gtk-widget object.
 

Slot Access Functions

Inherited Slot Access Functions

See also

*2021-9-9