<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
<!ENTITY pi "&#960;">
<!ENTITY solidus "&#8260;">
]>
<refentry id="GtkPicture">
<refmeta>
<refentrytitle role="top_of_page" id="GtkPicture.top_of_page">GtkPicture</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkPicture</refname>
<refpurpose>A widget displaying a <link linkend="GdkPaintable"><type>GdkPaintable</type></link></refpurpose>
</refnamediv>

<refsect1 id="GtkPicture.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new">gtk_picture_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new-for-paintable">gtk_picture_new_for_paintable</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new-for-pixbuf">gtk_picture_new_for_pixbuf</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new-for-file">gtk_picture_new_for_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new-for-filename">gtk_picture_new_for_filename</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-new-for-resource">gtk_picture_new_for_resource</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-paintable">gtk_picture_set_paintable</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkPaintable"><returnvalue>GdkPaintable</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-get-paintable">gtk_picture_get_paintable</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-pixbuf">gtk_picture_set_pixbuf</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-file">gtk_picture_set_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GFile"><returnvalue>GFile</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-get-file">gtk_picture_get_file</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-filename">gtk_picture_set_filename</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-resource">gtk_picture_set_resource</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-keep-aspect-ratio">gtk_picture_set_keep_aspect_ratio</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-get-keep-aspect-ratio">gtk_picture_get_keep_aspect_ratio</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-can-shrink">gtk_picture_set_can_shrink</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-get-can-shrink">gtk_picture_get_can_shrink</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-picture-set-alternative-text">gtk_picture_set_alternative_text</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gtk-picture-get-alternative-text">gtk_picture_get_alternative_text</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkPicture.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="gchar"><type>gchar</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkPicture--alternative-text">alternative-text</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkPicture--can-shrink">can-shrink</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GFile"><type>GFile</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkPicture--file">file</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GtkPicture--keep-aspect-ratio">keep-aspect-ratio</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="GdkPaintable"><type>GdkPaintable</type></link>&#160;*</entry><entry role="property_name"><link linkend="GtkPicture--paintable">paintable</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkPicture.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GtkPicture-struct">GtkPicture</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkPicture.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GtkWidget">GtkWidget</link>
            <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GtkPicture
</screen>
</refsect1>
<refsect1 id="GtkPicture.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkPicture implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>.</para>

</refsect1>

<refsect1 id="GtkPicture.includes"><title>Includes</title><synopsis>#include &lt;gtk/gtk.h&gt;
</synopsis></refsect1>

<refsect1 id="GtkPicture.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GtkPicture"><type>GtkPicture</type></link> widget displays a <link linkend="GdkPaintable"><type>GdkPaintable</type></link>. 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’s a convenience function
to do this:</para>
<informalexample><programlisting role="example"><![CDATA[
  GtkWidget *widget;
  widget = gtk_picture_new_for_filename ("myfile.png");
]]></programlisting></informalexample>
<para>
If the file isn’t 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
<link linkend="gdk-texture-new-from-file"><function>gdk_texture_new_from_file()</function></link>, then create the <link linkend="GtkPicture"><type>GtkPicture</type></link> with
<link linkend="gtk-picture-new-for-paintable"><function>gtk_picture_new_for_paintable()</function></link>.</para>
<para>Sometimes an application will want to avoid depending on external data
files, such as image files. See the documentation of <link linkend="GResource"><type>GResource</type></link> for details.
In this case, <link linkend="gtk-picture-new-for-resource"><function>gtk_picture_new_for_resource()</function></link> and <link linkend="gtk-picture-set-resource"><function>gtk_picture_set_resource()</function></link>
should be used.</para>
<refsect2><title>CSS nodes</title><para>GtkPicture has a single CSS node with the name picture.</para>
</refsect2>

</refsect1>
<refsect1 id="GtkPicture.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-picture-new" role="function">
<title>gtk_picture_new&#160;()</title>
<indexterm zone="gtk-picture-new"><primary>gtk_picture_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new empty <link linkend="GtkPicture"><type>GtkPicture</type></link> widget.</para>
<refsect3 id="gtk-picture-new.returns" role="returns">
<title>Returns</title>
<para> a newly created <link linkend="GtkPicture"><type>GtkPicture</type></link> widget.</para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-new-for-paintable" role="function">
<title>gtk_picture_new_for_paintable&#160;()</title>
<indexterm zone="gtk-picture-new-for-paintable"><primary>gtk_picture_new_for_paintable</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new_for_paintable (<parameter><link linkend="GdkPaintable"><type>GdkPaintable</type></link> *paintable</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkPicture"><type>GtkPicture</type></link> displaying <parameter>paintable</parameter>
.</para>
<para>The <link linkend="GtkPicture"><type>GtkPicture</type></link> will track changes to the <parameter>paintable</parameter>
 and update
its size and contents in response to it.</para>
<refsect3 id="gtk-picture-new-for-paintable.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>paintable</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPaintable"><type>GdkPaintable</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-new-for-paintable.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkPicture"><type>GtkPicture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-new-for-pixbuf" role="function">
<title>gtk_picture_new_for_pixbuf&#160;()</title>
<indexterm zone="gtk-picture-new-for-pixbuf"><primary>gtk_picture_new_for_pixbuf</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new_for_pixbuf (<parameter><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> *pixbuf</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkPicture"><type>GtkPicture</type></link> displaying <parameter>pixbuf</parameter>
.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-new-for-paintable"><function>gtk_picture_new_for_paintable()</function></link>,
See that function for details.</para>
<para>The pixbuf must not be modified after passing it to this function.</para>
<refsect3 id="gtk-picture-new-for-pixbuf.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>pixbuf</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-new-for-pixbuf.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkPicture"><type>GtkPicture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-new-for-file" role="function">
<title>gtk_picture_new_for_file&#160;()</title>
<indexterm zone="gtk-picture-new-for-file"><primary>gtk_picture_new_for_file</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new_for_file (<parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkPicture"><type>GtkPicture</type></link> displaying the given <parameter>file</parameter>
. If the file
isn’t found or can’t be loaded, the resulting <link linkend="GtkPicture"><type>GtkPicture</type></link> be empty.</para>
<para>If you need to detect failures to load the file, use
<link linkend="gdk-texture-new-from-file"><function>gdk_texture_new_from_file()</function></link> to load the file yourself, then create
the <link linkend="GtkPicture"><type>GtkPicture</type></link> from the texture.</para>
<refsect3 id="gtk-picture-new-for-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFile"><type>GFile</type></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-new-for-file.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkPicture"><type>GtkPicture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-new-for-filename" role="function">
<title>gtk_picture_new_for_filename&#160;()</title>
<indexterm zone="gtk-picture-new-for-filename"><primary>gtk_picture_new_for_filename</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new_for_filename (<parameter>const <link linkend="gchar"><type>gchar</type></link> *filename</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkPicture"><type>GtkPicture</type></link> displaying the file <parameter>filename</parameter>
.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-new-for-file"><function>gtk_picture_new_for_file()</function></link>.
See that function for details.</para>
<refsect3 id="gtk-picture-new-for-filename.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>filename</para></entry>
<entry role="parameter_description"><para>a filename. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>type</acronym> filename][<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-new-for-filename.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkPicture"><type>GtkPicture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-new-for-resource" role="function">
<title>gtk_picture_new_for_resource&#160;()</title>
<indexterm zone="gtk-picture-new-for-resource"><primary>gtk_picture_new_for_resource</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_picture_new_for_resource (<parameter>const <link linkend="gchar"><type>gchar</type></link> *resource_path</parameter>);</programlisting>
<para>Creates a new <link linkend="GtkPicture"><type>GtkPicture</type></link> displaying the file <parameter>filename</parameter>
.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-new-for-file"><function>gtk_picture_new_for_file()</function></link>.
See that function for details.</para>
<refsect3 id="gtk-picture-new-for-resource.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>resource_path</para></entry>
<entry role="parameter_description"><para>resource path to play back. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-new-for-resource.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkPicture"><type>GtkPicture</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-paintable" role="function">
<title>gtk_picture_set_paintable&#160;()</title>
<indexterm zone="gtk-picture-set-paintable"><primary>gtk_picture_set_paintable</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_paintable (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                           <parameter><link linkend="GdkPaintable"><type>GdkPaintable</type></link> *paintable</parameter>);</programlisting>
<para>Makes <parameter>self</parameter>
 display the given <parameter>paintable</parameter>
. If <parameter>paintable</parameter>
 is <link linkend="NULL:CAPS"><literal>NULL</literal></link>,
nothing will be displayed.</para>
<para>See <link linkend="gtk-picture-new-for-paintable"><function>gtk_picture_new_for_paintable()</function></link> for details.</para>
<refsect3 id="gtk-picture-set-paintable.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>paintable</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPaintable"><type>GdkPaintable</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-get-paintable" role="function">
<title>gtk_picture_get_paintable&#160;()</title>
<indexterm zone="gtk-picture-get-paintable"><primary>gtk_picture_get_paintable</primary></indexterm>
<programlisting language="C"><link linkend="GdkPaintable"><returnvalue>GdkPaintable</returnvalue></link>&#160;*
gtk_picture_get_paintable (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>);</programlisting>
<para>Gets the <link linkend="GdkPaintable"><type>GdkPaintable</type></link> being displayed by the <link linkend="GtkPicture"><type>GtkPicture</type></link>.</para>
<refsect3 id="gtk-picture-get-paintable.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-get-paintable.returns" role="returns">
<title>Returns</title>
<para>the displayed paintable, or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
the picture is empty. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-pixbuf" role="function">
<title>gtk_picture_set_pixbuf&#160;()</title>
<indexterm zone="gtk-picture-set-pixbuf"><primary>gtk_picture_set_pixbuf</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_pixbuf (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                        <parameter><link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> *pixbuf</parameter>);</programlisting>
<para>See <link linkend="gtk-picture-new-for-pixbuf"><function>gtk_picture_new_for_pixbuf()</function></link> for details.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-set-paintable"><function>gtk_picture_set_paintable()</function></link>,</para>
<refsect3 id="gtk-picture-set-pixbuf.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pixbuf</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPixbuf"><type>GdkPixbuf</type></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-file" role="function">
<title>gtk_picture_set_file&#160;()</title>
<indexterm zone="gtk-picture-set-file"><primary>gtk_picture_set_file</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_file (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                      <parameter><link linkend="GFile"><type>GFile</type></link> *file</parameter>);</programlisting>
<para>Makes <parameter>self</parameter>
 load and display <parameter>file</parameter>
.</para>
<para>See <link linkend="gtk-picture-new-for-file"><function>gtk_picture_new_for_file()</function></link> for details.</para>
<refsect3 id="gtk-picture-set-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>file</para></entry>
<entry role="parameter_description"><para>a <link linkend="GFile"><literal>GFile</literal></link> or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-get-file" role="function">
<title>gtk_picture_get_file&#160;()</title>
<indexterm zone="gtk-picture-get-file"><primary>gtk_picture_get_file</primary></indexterm>
<programlisting language="C"><link linkend="GFile"><returnvalue>GFile</returnvalue></link>&#160;*
gtk_picture_get_file (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>);</programlisting>
<para>Gets the <link linkend="GFile"><type>GFile</type></link> currently displayed if <parameter>self</parameter>
 is displaying a file.
If <parameter>self</parameter>
 is not displaying a file, for example when <link linkend="gtk-picture-set-paintable"><function>gtk_picture_set_paintable()</function></link>
was used, then <link linkend="NULL:CAPS"><literal>NULL</literal></link> is returned.</para>
<refsect3 id="gtk-picture-get-file.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-get-file.returns" role="returns">
<title>Returns</title>
<para>The <link linkend="GFile"><type>GFile</type></link> displayed by <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-filename" role="function">
<title>gtk_picture_set_filename&#160;()</title>
<indexterm zone="gtk-picture-set-filename"><primary>gtk_picture_set_filename</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_filename (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                          <parameter>const <link linkend="gchar"><type>gchar</type></link> *filename</parameter>);</programlisting>
<para>Makes <parameter>self</parameter>
 load and display the given <parameter>filename</parameter>
.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-set-file"><function>gtk_picture_set_file()</function></link>.</para>
<refsect3 id="gtk-picture-set-filename.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>filename</para></entry>
<entry role="parameter_description"><para>the filename to play. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-resource" role="function">
<title>gtk_picture_set_resource&#160;()</title>
<indexterm zone="gtk-picture-set-resource"><primary>gtk_picture_set_resource</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_resource (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                          <parameter>const <link linkend="gchar"><type>gchar</type></link> *resource_path</parameter>);</programlisting>
<para>Makes <parameter>self</parameter>
 load and display the resource at the given
<parameter>resource_path</parameter>
.</para>
<para>This is a utility function that calls <link linkend="gtk-picture-set-file"><function>gtk_picture_set_file()</function></link>,</para>
<refsect3 id="gtk-picture-set-resource.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>resource_path</para></entry>
<entry role="parameter_description"><para>the resource to set. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-keep-aspect-ratio" role="function">
<title>gtk_picture_set_keep_aspect_ratio&#160;()</title>
<indexterm zone="gtk-picture-set-keep-aspect-ratio"><primary>gtk_picture_set_keep_aspect_ratio</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_keep_aspect_ratio (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                                   <parameter><link linkend="gboolean"><type>gboolean</type></link> keep_aspect_ratio</parameter>);</programlisting>
<para>If set to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the <parameter>self</parameter>
 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 <parameter>self</parameter>
.</para>
<para>If set to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> or if the contents provide no aspect ratio, the
contents will be stretched over the picture's whole area.</para>
<refsect3 id="gtk-picture-set-keep-aspect-ratio.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>keep_aspect_ratio</para></entry>
<entry role="parameter_description"><para>whether to keep aspect ratio</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-get-keep-aspect-ratio" role="function">
<title>gtk_picture_get_keep_aspect_ratio&#160;()</title>
<indexterm zone="gtk-picture-get-keep-aspect-ratio"><primary>gtk_picture_get_keep_aspect_ratio</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_picture_get_keep_aspect_ratio (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>);</programlisting>
<para>Gets the value set via <link linkend="gtk-picture-set-keep-aspect-ratio"><function>gtk_picture_set_keep_aspect_ratio()</function></link>.</para>
<refsect3 id="gtk-picture-get-keep-aspect-ratio.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-get-keep-aspect-ratio.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the self tries to keep the contents' aspect ratio</para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-can-shrink" role="function">
<title>gtk_picture_set_can_shrink&#160;()</title>
<indexterm zone="gtk-picture-set-can-shrink"><primary>gtk_picture_set_can_shrink</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_can_shrink (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                            <parameter><link linkend="gboolean"><type>gboolean</type></link> can_shrink</parameter>);</programlisting>
<para>If set to <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the <parameter>self</parameter>
 can be made smaller than its contents.
The contents will then be scaled down when rendering.</para>
<para>If you want to still force a minimum size manually, consider using
<link linkend="gtk-widget-set-size-request"><function>gtk_widget_set_size_request()</function></link>.</para>
<para>Also of note is that a similar function for growing does not exist
because the grow behavior can be controlled via
<link linkend="gtk-widget-set-halign"><function>gtk_widget_set_halign()</function></link> and <link linkend="gtk-widget-set-valign"><function>gtk_widget_set_valign()</function></link>.</para>
<refsect3 id="gtk-picture-set-can-shrink.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>can_shrink</para></entry>
<entry role="parameter_description"><para>if <parameter>self</parameter>
can be made smaller than its contents</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-get-can-shrink" role="function">
<title>gtk_picture_get_can_shrink&#160;()</title>
<indexterm zone="gtk-picture-get-can-shrink"><primary>gtk_picture_get_can_shrink</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gtk_picture_get_can_shrink (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>);</programlisting>
<para>Gets the value set via <link linkend="gtk-picture-set-can-shrink"><function>gtk_picture_set_can_shrink()</function></link>.</para>
<refsect3 id="gtk-picture-get-can-shrink.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-get-can-shrink.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the picture can be made smaller than its contents</para>
</refsect3></refsect2>
<refsect2 id="gtk-picture-set-alternative-text" role="function">
<title>gtk_picture_set_alternative_text&#160;()</title>
<indexterm zone="gtk-picture-set-alternative-text"><primary>gtk_picture_set_alternative_text</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_picture_set_alternative_text (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>,
                                  <parameter>const <link linkend="char"><type>char</type></link> *alternative_text</parameter>);</programlisting>
<para>Sets an alternative textual description for the picture contents.
It is equivalent to the "alt" attribute for images on websites.</para>
<para>This text will be made available to accessibility tools.</para>
<para>If the picture cannot be described textually, set this property to <link linkend="NULL:CAPS"><literal>NULL</literal></link>.</para>
<refsect3 id="gtk-picture-set-alternative-text.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>alternative_text</para></entry>
<entry role="parameter_description"><para>a textual description of the contents. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>nullable</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-picture-get-alternative-text" role="function">
<title>gtk_picture_get_alternative_text&#160;()</title>
<indexterm zone="gtk-picture-get-alternative-text"><primary>gtk_picture_get_alternative_text</primary></indexterm>
<programlisting language="C">const <link linkend="char"><returnvalue>char</returnvalue></link>&#160;*
gtk_picture_get_alternative_text (<parameter><link linkend="GtkPicture"><type>GtkPicture</type></link> *self</parameter>);</programlisting>
<para>Gets the alternative textual description of the picture or returns <link linkend="NULL:CAPS"><literal>NULL</literal></link> if
the picture cannot be described textually.</para>
<refsect3 id="gtk-picture-get-alternative-text.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>self</para></entry>
<entry role="parameter_description"><para>a <link linkend="GtkPicture"><type>GtkPicture</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-picture-get-alternative-text.returns" role="returns">
<title>Returns</title>
<para>the alternative textual description
of <parameter>self</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>nullable</acronym>][<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="GtkPicture.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GtkPicture-struct" role="struct">
<title>GtkPicture</title>
<indexterm zone="GtkPicture-struct"><primary>GtkPicture</primary></indexterm>
<programlisting language="C">typedef struct _GtkPicture GtkPicture;</programlisting>
</refsect2>

</refsect1>
<refsect1 id="GtkPicture.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkPicture--alternative-text" role="property"><title>The <literal>“alternative-text”</literal> property</title>
<indexterm zone="GtkPicture--alternative-text"><primary>GtkPicture:alternative-text</primary></indexterm>
<programlisting>  “alternative-text”         <link linkend="gchar"><type>gchar</type></link>&#160;*</programlisting>
<para>The alternative textual description for the picture.</para>
<para>Owner: GtkPicture</para>
<para>Flags: Read / Write</para>
<para>Default value: NULL</para>
</refsect2>
<refsect2 id="GtkPicture--can-shrink" role="property"><title>The <literal>“can-shrink”</literal> property</title>
<indexterm zone="GtkPicture--can-shrink"><primary>GtkPicture:can-shrink</primary></indexterm>
<programlisting>  “can-shrink”               <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>If the <link linkend="GtkPicture"><type>GtkPicture</type></link> can be made smaller than the self it contains.</para>
<para>Owner: GtkPicture</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkPicture--file" role="property"><title>The <literal>“file”</literal> property</title>
<indexterm zone="GtkPicture--file"><primary>GtkPicture:file</primary></indexterm>
<programlisting>  “file”                     <link linkend="GFile"><type>GFile</type></link>&#160;*</programlisting>
<para>The <link linkend="GFile"><type>GFile</type></link> that is displayed or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none.</para>
<para>Owner: GtkPicture</para>
<para>Flags: Read / Write</para>
</refsect2>
<refsect2 id="GtkPicture--keep-aspect-ratio" role="property"><title>The <literal>“keep-aspect-ratio”</literal> property</title>
<indexterm zone="GtkPicture--keep-aspect-ratio"><primary>GtkPicture:keep-aspect-ratio</primary></indexterm>
<programlisting>  “keep-aspect-ratio”        <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether the GtkPicture will render its contents trying to preserve the aspect
ratio of the contents.</para>
<para>Owner: GtkPicture</para>
<para>Flags: Read / Write</para>
<para>Default value: TRUE</para>
</refsect2>
<refsect2 id="GtkPicture--paintable" role="property"><title>The <literal>“paintable”</literal> property</title>
<indexterm zone="GtkPicture--paintable"><primary>GtkPicture:paintable</primary></indexterm>
<programlisting>  “paintable”                <link linkend="GdkPaintable"><type>GdkPaintable</type></link>&#160;*</programlisting>
<para>The <link linkend="GdkPaintable"><type>GdkPaintable</type></link> to be displayed by this <link linkend="GtkPicture"><type>GtkPicture</type></link>.</para>
<para>Owner: GtkPicture</para>
<para>Flags: Read / Write</para>
</refsect2>

</refsect1>

</refentry>
