package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gdk/Ocgtk_gdk/Gdk/Wrappers/Toplevel/index.html

Module Wrappers.Toplevel

type t = [ `toplevel ] Gobject.obj
val from_gobject : 'a Gobject.obj -> t
val titlebar_gesture : t -> Gdk_enums.titlebargesture -> bool
val supports_edge_constraints : t -> bool

Returns whether the desktop environment supports tiled window states.

val show_window_menu : t -> [ `event ] Gobject.obj -> bool

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.

val set_transient_for : t -> [ `surface | `object_ ] Gobject.obj -> unit

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()(../gtk4/method.Window.set_transient_for.html) if you’re using GtkWindow(../gtk4/class.Window.html).

val set_title : t -> string -> unit

Sets the title of a toplevel surface.

The title maybe be displayed in the titlebar, in lists of windows, etc.

val set_startup_id : t -> string -> unit

Sets the startup notification ID.

When using GTK, typically you should use gtk_window_set_startup_id()(../gtk4/method.Window.set_startup_id.html) instead of this low-level function.

val set_modal : t -> bool -> unit

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.

val set_icon_list : t -> [ `texture | `object_ ] Gobject.obj list -> unit

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.

val set_deletable : t -> bool -> unit

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.

val set_decorated : t -> bool -> unit

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.

val restore_system_shortcuts : t -> unit

Restore default system keyboard shortcuts which were previously inhibited.

This undoes the effect of method@Gdk.Toplevel.inhibit_system_shortcuts.

val present : t -> [ `toplevel_layout ] Gobject.obj -> unit

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.

val minimize : t -> bool

Asks to minimize the @toplevel.

The windowing system may choose to ignore the request.

val lower : t -> bool

Asks to lower the @toplevel below other windows.

The windowing system may choose to ignore the request.

val inhibit_system_shortcuts : t -> [ `event ] Gobject.obj option -> unit

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.

val get_state : t -> Gdk_enums.toplevelstate

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

val focus : t -> UInt32.t -> unit

Sets keyboard focus to @surface.

In most cases, gtk_window_present_with_time()(../gtk4/method.Window.present_with_time.html) should be used on a GtkWindow(../gtk4/class.Window.html), rather than calling this function.

val begin_resize : t -> Gdk_enums.surfaceedge -> [ `device | `object_ ] Gobject.obj option -> int -> float -> float -> UInt32.t -> unit

Begins an interactive resize operation.

You might use this function to implement a “window resize grip.”

val begin_move : t -> [ `device | `object_ ] Gobject.obj -> int -> float -> float -> UInt32.t -> unit

Begins an interactive move operation.

You might use this function to implement draggable titlebars.

val get_fullscreen_mode : t -> Gdk_enums.fullscreenmode

Get property: fullscreen-mode

val set_fullscreen_mode : t -> Gdk_enums.fullscreenmode -> unit

Set property: fullscreen-mode

val get_shortcuts_inhibited : t -> bool

Get property: shortcuts-inhibited