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.gtk/Ocgtk_gtk/Gtk/Wrappers/File_dialog/index.html

Module Wrappers.File_dialog

type t = [ `file_dialog | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new FileDialog

val set_title : t -> string -> unit

Sets the title that will be shown on the file chooser dialog.

val set_modal : t -> bool -> unit

Sets whether the file chooser dialog blocks interaction with the parent window while it is presented.

val set_initial_name : t -> string option -> unit

Sets the name for the file that should be initially set. For saving dialogs, this will usually be pre-entered into the name field.

If a file with this name already exists in the directory set via property@Gtk.FileDialog:initial-folder, the dialog should preselect it.

val set_initial_folder : t -> Ocgtk_gio.Gio.Wrappers.File.t option -> unit

Sets the folder that will be set as the initial folder in the file chooser dialog.

val set_initial_file : t -> Ocgtk_gio.Gio.Wrappers.File.t option -> unit

Sets the file that will be initially selected in the file chooser dialog.

This function is a shortcut for calling both gtk_file_dialog_set_initial_folder() and gtk_file_dialog_set_initial_name() with the directory and name of @file respectively.

val set_filters : t -> Ocgtk_gio.Gio.Wrappers.List_model.t option -> unit

Sets the filters that will be offered to the user in the file chooser dialog.

val set_default_filter : t -> [ `file_filter | `filter | `object_ ] Gobject.obj option -> unit

Sets the filter that will be selected by default in the file chooser dialog.

If set to %NULL, the first item in property@Gtk.FileDialog:filters will be used as the default filter. If that list is empty, the dialog will be unfiltered.

val set_accept_label : t -> string option -> unit

Sets the label shown on the file chooser's accept button.

Leaving the accept label unset or setting it as `NULL` will fall back to a default label, depending on what API is used to launch the file dialog.

Finishes the method@Gtk.FileDialog.select_multiple_folders call and returns the resulting files in a `GListModel`.

Finishes the method@Gtk.FileDialog.select_folder call and returns the resulting file.

Finishes the method@Gtk.FileDialog.save call and returns the resulting file.

Finishes the method@Gtk.FileDialog.open call and returns the resulting files in a `GListModel`.

Finishes the method@Gtk.FileDialog.open call and returns the resulting file.

val get_title : t -> string

Returns the title that will be shown on the file chooser dialog.

val get_modal : t -> bool

Returns whether the file chooser dialog blocks interaction with the parent window while it is presented.

val get_initial_name : t -> string option

Gets the name for the file that should be initially set.

val get_initial_folder : t -> Ocgtk_gio.Gio.Wrappers.File.t option

Gets the folder that will be set as the initial folder in the file chooser dialog.

val get_initial_file : t -> Ocgtk_gio.Gio.Wrappers.File.t option

Gets the file that will be initially selected in the file chooser dialog.

val get_filters : t -> Ocgtk_gio.Gio.Wrappers.List_model.t option

Gets the filters that will be offered to the user in the file chooser dialog.

val get_default_filter : t -> [ `file_filter | `filter | `object_ ] Gobject.obj option

Gets the filter that will be selected by default in the file chooser dialog.

val get_accept_label : t -> string option