package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Application/index.html
Module Wrappers.Application
type t = [ `application | `object_ ] Gobject.objval new_ : string option -> Ocgtk_gio.Gio.applicationflags -> tCreate a new Application
val uninhibit : t -> int -> unitRemoves an inhibitor that has been previously established.
See method@Gtk.Application.inhibit.
Inhibitors are also cleared when the application exits.
Sets or unsets the menubar for windows of `application`.
This is a menubar in the traditional sense.
This can only be done in the primary instance of the application, after it has been registered. `GApplication::startup` is a good place to call this.
Depending on the desktop environment, this may appear at the top of each window, or at the top of the screen. In some environments, if both the application menu and the menubar are set, the application menu will be presented as if it were the first item of the menubar. Other environments treat the two as completely separate — for example, the application menu may be rendered by the desktop shell while the menubar (if set) remains in each individual window.
Use the base `GActionMap` interface to add actions, to respond to the user selecting these menu items.
val set_accels_for_action : t -> string -> string array -> unitSets zero or more keyboard accelerators that will trigger the given action.
The first item in `accels` will be the primary accelerator, which may be displayed in the UI.
To remove all accelerators for an action, use an empty, zero-terminated array for `accels`.
For the `detailed_action_name`, see `g_action_parse_detailed_name()` and `g_action_print_detailed_name()`.
val remove_window :
t ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj ->
unitRemove a window from `application`.
If `window` belongs to `application` then this call is equivalent to setting the property@Gtk.Window:application property of `window` to `NULL`.
The application may stop running as a result of a call to this function, if `window` was the last window of the `application`.
val list_action_descriptions : t -> string arrayLists the detailed action names which have associated accelerators.
See method@Gtk.Application.set_accels_for_action.
val inhibit :
t ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj option ->
Gtk_enums.applicationinhibitflags ->
string option ->
intInform the session manager that certain types of actions should be inhibited.
This is not guaranteed to work on all platforms and for all types of actions.
Applications should invoke this method when they begin an operation that should not be interrupted, such as creating a CD or DVD. The types of actions that may be blocked are specified by the `flags` parameter. When the application completes the operation it should call method@Gtk.Application.uninhibit to remove the inhibitor. Note that an application can have multiple inhibitors, and all of them must be individually removed. Inhibitors are also cleared when the application exits.
Applications should not expect that they will always be able to block the action. In most cases, users will be given the option to force the action to take place.
The `reason` message should be short and to the point.
If `window` is given, the session manager may point the user to this window to find out more about why the action is inhibited.
val get_windows :
t ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj listGets a list of the class@Gtk.Window instances associated with `application`.
The list is sorted by most recently focused window, such that the first element is the currently focused window. (Useful for choosing a parent for a transient window.)
The list that is returned should not be modified in any way. It will only remain valid until the next focus change or window creation or deletion.
val get_window_by_id :
t ->
int ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj optionReturns the class@Gtk.ApplicationWindow with the given ID.
The ID of a `GtkApplicationWindow` can be retrieved with method@Gtk.ApplicationWindow.get_id.
Returns the menu model that has been set with method@Gtk.Application.set_menubar.
Gets a menu from automatically loaded resources.
See the section on Automatic resources(class.Application.html#automatic-resources) for more information.
val get_active_window :
t ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj optionGets the “active” window for the application.
The active window is the one that was most recently focused (within the application). This window may not have the focus at the moment if another application has it — this is just the most recently-focused window within this application.
val get_actions_for_accel : t -> string -> string arrayReturns the list of actions (possibly empty) that `accel` maps to.
Each item in the list is a detailed action name in the usual form.
This might be useful to discover if an accel already exists in order to prevent installation of a conflicting accelerator (from an accelerator editor or a plugin system, for example). Note that having more than one action per accelerator may not be a bad thing and might make sense in cases where the actions never appear in the same context.
In case there are no actions for a given accelerator, an empty array is returned. `NULL` is never returned.
It is a programmer error to pass an invalid accelerator string.
If you are unsure, check it with func@Gtk.accelerator_parse first.
val get_accels_for_action : t -> string -> string arrayGets the accelerators that are currently associated with the given action.
val add_window :
t ->
[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj ->
unitAdds a window to `application`.
This call can only happen after the `application` has started; typically, you should add new application windows in response to the emission of the `GApplication::activate` signal.
This call is equivalent to setting the property@Gtk.Window:application property of `window` to `application`.
Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it with method@Gtk.Application.remove_window.
GTK will keep the `application` running as long as it has any windows.
val get_register_session : t -> boolGet property: register-session
val set_register_session : t -> bool -> unitSet property: register-session
val get_screensaver_active : t -> boolGet property: screensaver-active
val on_query_end :
?after:bool ->
t ->
callback:(unit -> unit) ->
Gobject.Signal.handler_idval on_window_added :
?after:bool ->
t ->
callback:
(window:[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj ->
unit) ->
Gobject.Signal.handler_idval on_window_removed :
?after:bool ->
t ->
callback:
(window:[ `window | `widget | `initially_unowned | `object_ ] Gobject.obj ->
unit) ->
Gobject.Signal.handler_id