Gdk.Toplevel¶
- Implementations:
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
None
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
|||
r/w/en |
|||
r |
|||
r/w/en |
|||
r/w/en |
Signals¶
Name |
Short Description |
---|---|
Emitted when the size for the surface needs to be computed, when it is present. |
Fields¶
None
Class Details¶
- class Gdk.Toplevel¶
- Bases:
- Structure:
A
GdkToplevel
is a freestanding toplevel surface.The
GdkToplevel
interface provides useful APIs for interacting with the windowing system, such as controlling maximization and size of the surface, setting icons and transient parents for dialogs.- begin_move(device, button, x, y, timestamp)[source]¶
- Parameters:
device (
Gdk.Device
) – the device used for the operationbutton (
int
) – the button being used to drag, or 0 for a keyboard-initiated dragx (
float
) – surface X coordinate of mouse click that began the dragy (
float
) – surface Y coordinate of mouse click that began the dragtimestamp (
int
) – timestamp of mouse click that began the drag (use [method`Gdk`.Event.get_time])
Begins an interactive move operation.
You might use this function to implement draggable titlebars.
- begin_resize(edge, device, button, x, y, timestamp)[source]¶
- Parameters:
edge (
Gdk.SurfaceEdge
) – the edge or corner from which the drag is starteddevice (
Gdk.Device
orNone
) – the device used for the operationbutton (
int
) – the button being used to drag, or 0 for a keyboard-initiated dragx (
float
) – surface X coordinate of mouse click that began the dragy (
float
) – surface Y coordinate of mouse click that began the dragtimestamp (
int
) – timestamp of mouse click that began the drag (use [method`Gdk`.Event.get_time])
Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
- focus(timestamp)[source]¶
- Parameters:
timestamp (
int
) – timestamp of the event triggering the surface focus
Sets keyboard focus to surface.
In most cases, gtk_window_present_with_time() should be used on a GtkWindow, rather than calling this function.
- get_state()[source]¶
- Returns:
surface state bitfield
- Return type:
Gets the bitwise or of the currently active surface state flags, from the
GdkToplevelState
enumeration.
- inhibit_system_shortcuts(event)[source]¶
- Parameters:
event (
Gdk.Event
orNone
) – theGdkEvent
that is triggering the inhibit request, orNone
if none is available
Requests that the self inhibit the system shortcuts.
This is asking the desktop environment/windowing system to let all keyboard events reach the surface, as long as it is focused, instead of triggering system actions.
If granted, the rerouting remains active until the default shortcuts processing is restored with [method`Gdk`.Toplevel.restore_system_shortcuts], or the request is revoked by the desktop environment, windowing system or the user.
A typical use case for this API is remote desktop or virtual machine viewers which need to inhibit the default system keyboard shortcuts so that the remote session or virtual host gets those instead of the local environment.
The windowing system or desktop environment may ask the user to grant or deny the request or even choose to ignore the request entirely.
The caller can be notified whenever the request is granted or revoked by listening to the [property`Gdk`.Toplevel:shortcuts-inhibited] property.
- lower()[source]¶
-
Asks to lower the self below other windows.
The windowing system may choose to ignore the request.
- minimize()[source]¶
-
Asks to minimize the self.
The windowing system may choose to ignore the request.
- present(layout)[source]¶
- Parameters:
layout (
Gdk.ToplevelLayout
) – theGdkToplevelLayout
object used to layout
Present self after having processed the
GdkToplevelLayout
rules.If the toplevel was previously not showing, it will be showed, otherwise it will change layout according to layout.
GDK may emit the [signal`Gdk`.Toplevel::compute-size] signal to let the user of this toplevel compute the preferred size of the toplevel surface.
Presenting is asynchronous and the specified layout parameters are not guaranteed to be respected.
- restore_system_shortcuts()[source]¶
Restore default system keyboard shortcuts which were previously inhibited.
This undoes the effect of [method`Gdk`.Toplevel.inhibit_system_shortcuts].
- set_decorated(decorated)[source]¶
-
Sets the toplevel to be decorated.
Setting decorated to
False
hints the desktop environment that the surface has its own, client-side decorations and does not need to have window decorations added.
- set_deletable(deletable)[source]¶
-
Sets the toplevel to be deletable.
Setting deletable to
True
hints the desktop environment that it should offer the user a way to close the surface.
- set_icon_list(surfaces)[source]¶
- Parameters:
surfaces ([
Gdk.Texture
]) – A list of textures to use as icon, of different sizes
Sets a list of icons for the surface.
One of these will be used to represent the surface in iconic form. The icon may be shown in window lists or task bars. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality.
Note that some platforms don’t support surface icons.
- set_modal(modal)[source]¶
-
Sets the toplevel to be modal.
The application can use this hint to tell the window manager that a certain surface has modal behaviour. The window manager can use this information to handle modal surfaces in a special way.
You should only use this on surfaces for which you have previously called [method`Gdk`.Toplevel.set_transient_for].
- set_startup_id(startup_id)[source]¶
- Parameters:
startup_id (
str
) – a string with startup-notification identifier
Sets the startup notification ID.
When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.
- set_title(title)[source]¶
- Parameters:
title (
str
) – title of surface
Sets the title of a toplevel surface.
The title maybe be displayed in the titlebar, in lists of windows, etc.
- set_transient_for(parent)[source]¶
- Parameters:
parent (
Gdk.Surface
) – another toplevelGdkSurface
Sets a transient-for parent.
Indicates to the window manager that surface is a transient dialog associated with the application surface parent. This allows the window manager to do things like center surface on parent and keep surface above parent.
See gtk_window_set_transient_for() if you’re using GtkWindow.
- Parameters:
event (
Gdk.Event
) – aGdkEvent
to show the menu for- Returns:
- Return type:
Asks the windowing system to show the window menu.
The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.
- supports_edge_constraints()[source]¶
-
Returns whether the desktop environment supports tiled window states.
- titlebar_gesture(gesture)[source]¶
- Parameters:
gesture (
Gdk.TitlebarGesture
) – aGdkTitlebarGesture
- Return type:
New in version 4.4.
Signal Details¶
- Gdk.Toplevel.signals.compute_size(toplevel, size)¶
- Signal Name:
compute-size
- Flags:
- Parameters:
toplevel (
Gdk.Toplevel
) – The object which received the signalsize (
Gdk.ToplevelSize
) – aGdkToplevelSize
Emitted when the size for the surface needs to be computed, when it is present.
This signal will normally be emitted during or after a call to [method`Gdk`.Toplevel.present], depending on the configuration received by the windowing system. It may also be emitted at any other point in time, in response to the windowing system spontaneously changing the configuration of the toplevel surface.
It is the responsibility of the toplevel user to handle this signal and compute the desired size of the toplevel, given the information passed via the [struct`Gdk`.ToplevelSize] object. Failing to do so will result in an arbitrary size being used as a result.
Property Details¶
- Gdk.Toplevel.props.decorated¶
- Name:
decorated
- Type:
- Default Value:
- Flags:
Whether the window manager should add decorations.
- Gdk.Toplevel.props.deletable¶
- Name:
deletable
- Type:
- Default Value:
- Flags:
Whether the window manager should allow to close the surface.
- Gdk.Toplevel.props.fullscreen_mode¶
- Name:
fullscreen-mode
- Type:
- Default Value:
- Flags:
The fullscreen mode of the surface.
- Gdk.Toplevel.props.icon_list¶
- Name:
icon-list
- Type:
- Default Value:
- Flags:
A list of textures to use as icon.
- Gdk.Toplevel.props.modal¶
- Name:
modal
- Type:
- Default Value:
- Flags:
Whether the surface is modal.
- Gdk.Toplevel.props.shortcuts_inhibited¶
- Name:
shortcuts-inhibited
- Type:
- Default Value:
- Flags:
Whether the surface should inhibit keyboard shortcuts.
- Gdk.Toplevel.props.startup_id¶
- Name:
startup-id
- Type:
- Default Value:
- Flags:
The startup ID of the surface.
See [class`Gdk`.AppLaunchContext] for more information about startup feedback.
- Gdk.Toplevel.props.state¶
- Name:
state
- Type:
- Default Value:
0
- Flags:
The state of the toplevel.
- Gdk.Toplevel.props.title¶
- Name:
title
- Type:
- Default Value:
- Flags:
The title of the surface.
- Gdk.Toplevel.props.transient_for¶
- Name:
transient-for
- Type:
- Default Value:
- Flags:
The transient parent of the surface.