package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Picture/index.html
Module Wrappers.Picture
type t = [ `picture | `widget | `initially_unowned | `object_ ] Gobject.objval new_ : unit -> tCreate a new Picture
val new_for_file : Ocgtk_gio.Gio.Wrappers.File.t option -> tCreate a new Picture
val new_for_filename : string option -> tCreate a new Picture
val new_for_paintable : Ocgtk_gdk.Gdk.Wrappers.Paintable.t option -> tCreate a new Picture
val new_for_pixbuf : Ocgtk_gdkpixbuf.GdkPixbuf.Wrappers.Pixbuf.t option -> tCreate a new Picture
val new_for_resource : string option -> tCreate a new Picture
val set_resource : t -> string option -> unitMakes @self load and display the resource at the given @resource_path.
This is a utility function that calls method@Gtk.Picture.set_file.
val set_pixbuf :
t ->
Ocgtk_gdkpixbuf.GdkPixbuf.Wrappers.Pixbuf.t option ->
unitSets a `GtkPicture` to show a `GdkPixbuf`.
See ctor@Gtk.Picture.new_for_pixbuf for details.
This is a utility function that calls method@Gtk.Picture.set_paintable.
val set_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t option -> unitMakes @self display the given @paintable.
If @paintable is %NULL, nothing will be displayed.
See ctor@Gtk.Picture.new_for_paintable for details.
val set_keep_aspect_ratio : t -> bool -> unitIf set to %TRUE, the @self will render its contents according to their aspect ratio.
That means that empty space may show up at the top/bottom or left/right of @self.
If set to %FALSE or if the contents provide no aspect ratio, the contents will be stretched over the picture's whole area.
val set_filename : t -> string option -> unitMakes @self load and display the given @filename.
This is a utility function that calls method@Gtk.Picture.set_file.
val set_file : t -> Ocgtk_gio.Gio.Wrappers.File.t option -> unitMakes @self load and display @file.
See ctor@Gtk.Picture.new_for_file for details.
val set_content_fit : t -> Gtk_enums.contentfit -> unitSets how the content should be resized to fit the `GtkPicture`.
See enum@Gtk.ContentFit for details.
val set_can_shrink : t -> bool -> unitIf set to %TRUE, the @self can be made smaller than its contents.
The contents will then be scaled down when rendering.
If you want to still force a minimum size manually, consider using method@Gtk.Widget.set_size_request.
Also of note is that a similar function for growing does not exist because the grow behavior can be controlled via method@Gtk.Widget.set_halign and method@Gtk.Widget.set_valign.
val set_alternative_text : t -> string option -> unitSets an alternative textual description for the picture contents.
It is equivalent to the "alt" attribute for images on websites.
This text will be made available to accessibility tools.
If the picture cannot be described textually, set this property to %NULL.
val get_paintable : t -> Ocgtk_gdk.Gdk.Wrappers.Paintable.t optionGets the `GdkPaintable` being displayed by the `GtkPicture`.
val get_keep_aspect_ratio : t -> boolReturns whether the `GtkPicture` preserves its contents aspect ratio.
val get_file : t -> Ocgtk_gio.Gio.Wrappers.File.t optionGets the `GFile` currently displayed if @self is displaying a file.
If @self is not displaying a file, for example when method@Gtk.Picture.set_paintable was used, then %NULL is returned.
val get_content_fit : t -> Gtk_enums.contentfitReturns the fit mode for the content of the `GtkPicture`.
See enum@Gtk.ContentFit for details.
val get_can_shrink : t -> boolReturns whether the `GtkPicture` respects its contents size.
val get_alternative_text : t -> string optionGets the alternative textual description of the picture.
The returned string will be %NULL if the picture cannot be described textually.