Package: gtk
Class gtk:picture
Superclassesgtk:widget, gobject:initially-unowned, gtk:accessible, gtk:buildable, gtk:constraint-target, gobject:object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails The gtk:picture widget displays a gdk:paintable object. ![]() Many convenience functions are provided to make pictures simple to use. For example, if you want to load an image from a file, and then display that, there is a convenience function to do this: (let ((picture (gtk:picture-new-for-filename "myfile.png"))) ... )If the file is not loaded successfully, the picture will contain a "broken image" icon similar to that used in many web browsers. If you want to handle errors in loading the file yourself, for example by displaying an error message, then load the image with the gdk:texture-new-from-file function, then create the gtk:picture widget with the gtk:picture-new-for-paintable function. Sometimes an application will want to avoid depending on external data files, such as image files. See the documentation of the g:resource API for details. In this case, the gtk:picture-new-for-resource and gtk:picture-set-resource functions should be used. Sizing the paintableYou can influence how the paintable is displayed inside the gtk:picture widget by changing the content-fit property. See the gtk:content-fit enumeration for details. The can-shrink property can be unset to make sure that paintables are never made smaller than their ideal size - but be careful if you do not know the size of the paintable in use, like when displaying user-loaded images. This can easily cause the picture to grow larger than the screen. The halign and valign properties can be used to make sure the paintable does not fill all available space but is instead displayed at its original size.CSS nodesAccessibility | Returned by
Slot Access Functions
Inherited Slot Access FunctionsSee also |
2024-10-13