Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: ToplevelComputesizeCallback

[551:7] extends: object

Generated low-level callback wrapper for GIR callback compute-size.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • ToplevelComputesizeCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, size, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: Toplevel

[16:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Toplevel (Handle = null)

    Creates a new Toplevel by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnComputesize (callback Fn, UserData = null)

    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.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Toplevel Self, ToplevelSize Size).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setDecorated (bool Value)

    Whether the window manager should add decorations.

    • @p Value is the new property value.
    • @r None.
  • setDeletable (bool Value)

    Whether the window manager should allow to close the surface.

    • @p Value is the new property value.
    • @r None.
  • setFullscreenmode (string Value)

    The fullscreen mode of the surface.

    • @p Value is the new property value.
    • @r None.
  • setGravity (string Value)

    The gravity to use when resizing a surface programmatically. Gravity describes which point of the surface we want to keep fixed (meaning that the surface will grow in the opposite direction). For example, a gravity of GDK_GRAVITY_NORTH_EAST means that we want to fix top right corner of the surface. This property is just a hint that may affect the result when negotiating toplevel sizes with the windowing system. It does not affect interactive resizes started with [method@Gdk.Toplevel.begin_resize].

    • @p Value is the new property value.
    • @r None.
  • setIconlist (Value)

    A list of textures to use as icon.

    • @p Value is the new property value.
    • @r None.
  • setModal (bool Value)

    Whether the surface is modal.

    • @p Value is the new property value.
    • @r None.
  • setStartupid (string Value)

    The startup ID of the surface. See [class@Gdk.AppLaunchContext] for more information about startup feedback.

    • @p Value is the new property value.
    • @r None.
  • setTitle (string Value)

    The title of the surface.

    • @p Value is the new property value.
    • @r None.
  • setTransientfor (object Value)

    The transient parent of the surface.

    • @p Value is the new property value.
    • @r None.
  • get_capabilities ()

    The capabilities that are available for this toplevel.

  • get_gravity ()

    Returns the gravity that is used when changing the toplevel size programmatically.

  • get_state ()

    Gets the bitwise or of the currently active surface state flags, from the GdkToplevelState enumeration.

  • inhibit_system_shortcuts (object event)

    Requests that the @toplevel 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.

    • @p event is the GdkEvent that is triggering the inhibit request, or %NULL if none is available.
    • @r None.
  • lower ()

    Asks to lower the @toplevel below other windows. The windowing system may choose to ignore the request.

  • minimize ()

    Asks to minimize the @toplevel. The windowing system may choose to ignore the request.

  • present (object layout)

    Present @toplevel 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.

    • @p layout is the GdkToplevelLayout object used to layout.
    • @r None.
  • restore_system_shortcuts ()

    Restore default system keyboard shortcuts which were previously inhibited. This undoes the effect of [method@Gdk.Toplevel.inhibit_system_shortcuts].

    • @r None.
  • set_decorated (bool decorated)

    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.

    • @p decorated is %TRUE to request decorations.
    • @r None.
  • set_deletable (bool deletable)

    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.

    • @p deletable is %TRUE to request a delete button.
    • @r None.
  • set_gravity (string gravity)

    Sets the gravity that is used when changing the toplevel size programmatically.

    • @p gravity is the new gravity.
    • @r None.
  • set_icon_list (object surfaces)

    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.

    • @p surfaces is A list of textures to use as icon, of different sizes.
    • @r None.
  • set_modal (bool modal)

    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].

    • @p modal is %TRUE if the surface is modal, %FALSE otherwise..
    • @r None.
  • set_startup_id (string startup_id)

    Sets the startup notification ID. When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.

    • @p startup_id is a string with startup-notification identifier.
    • @r None.
  • set_title (string title)

    Sets the title of a toplevel surface. The title maybe be displayed in the titlebar, in lists of windows, etc.

    • @p title is title of @surface.
    • @r None.
  • set_transient_for (object parent)

    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.
    • @p parent is another toplevel GdkSurface.
    • @r None.
  • show_window_menu (object event)

    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.

    • @p event is a GdkEvent to show the menu for.
  • supports_edge_constraints ()

    Returns whether the desktop environment supports tiled window states.

  • titlebar_gesture (string gesture)

    Performs a title bar gesture.

    • @p gesture is a GdkTitlebarGesture.

class: ToplevelMeta

[622:14] static extends: object

Generated metadata helpers for Toplevel interface surfaces.

Methods

  • properties ()

    Returns property metadata for Toplevel.

    • @r A list.
  • signals ()

    Returns signal metadata for Toplevel.

    • @r A list.