<?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="GtkDrawingArea">
<refmeta>
<refentrytitle role="top_of_page" id="GtkDrawingArea.top_of_page">GtkDrawingArea</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GTK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GtkDrawingArea</refname>
<refpurpose>A simple widget for drawing with cairo</refpurpose>
</refnamediv>

<refsect1 id="GtkDrawingArea.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-drawing-area-new">gtk_drawing_area_new</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drawing-area-get-content-width">gtk_drawing_area_get_content_width</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-drawing-area-set-content-width">gtk_drawing_area_set_content_width</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="int"><returnvalue>int</returnvalue></link>
</entry><entry role="function_name"><link linkend="gtk-drawing-area-get-content-height">gtk_drawing_area_get_content_height</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-drawing-area-set-content-height">gtk_drawing_area_set_content_height</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"><phrase role="c_punctuation">(</phrase><link linkend="GtkDrawingAreaDrawFunc">*GtkDrawingAreaDrawFunc</link><phrase role="c_punctuation">)</phrase>&#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-drawing-area-set-draw-func">gtk_drawing_area_set_draw_func</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDrawingArea.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="gint"><type>gint</type></link></entry><entry role="property_name"><link linkend="GtkDrawingArea--content-height">content-height</link></entry><entry role="property_flags">Read / Write</entry></row>
<row><entry role="property_type"><link linkend="gint"><type>gint</type></link></entry><entry role="property_name"><link linkend="GtkDrawingArea--content-width">content-width</link></entry><entry role="property_flags">Read / Write</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDrawingArea.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="signal_proto_type" colwidth="150px"/>
<colspec colname="signal_proto_name" colwidth="300px"/>
<colspec colname="signal_proto_flags" colwidth="200px"/>
<tbody>
<row><entry role="signal_type"><link linkend="void"><returnvalue>void</returnvalue></link></entry><entry role="signal_name"><link linkend="GtkDrawingArea-resize">resize</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDrawingArea.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">struct</entry><entry role="function_name"><link linkend="GtkDrawingArea-struct">GtkDrawingArea</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GtkDrawingArea.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> GtkDrawingArea
</screen>
</refsect1>
<refsect1 id="GtkDrawingArea.implemented-interfaces" role="impl_interfaces">
<title role="impl_interfaces.title">Implemented Interfaces</title>
<para>
GtkDrawingArea implements
 <link linkend="AtkImplementorIface">AtkImplementorIface</link>,  <link linkend="GtkBuildable">GtkBuildable</link> and  <link linkend="GtkConstraintTarget">GtkConstraintTarget</link>.</para>

</refsect1>

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

<refsect1 id="GtkDrawingArea.description" role="desc">
<title role="desc.title">Description</title>
<para>The <link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> widget is used for creating custom user interface
elements. It’s essentially a blank widget; you can draw on it. After
creating a drawing area, the application may want to connect to:</para>
<itemizedlist>
<listitem>
<para>The <link linkend="GtkWidget-realize"><type>“realize”</type></link> signal to take any necessary actions
when the widget is instantiated on a particular display.
(Create GDK resources in response to this signal.)</para>
</listitem>
<listitem>
<para>The <link linkend="GtkDrawingArea-resize"><type>“resize”</type></link> signal to take any necessary
actions when the widget changes size.</para>
</listitem>
<listitem>
<para>Call <link linkend="gtk-drawing-area-set-draw-func"><function>gtk_drawing_area_set_draw_func()</function></link> to handle redrawing the
contents of the widget.</para>
</listitem>
</itemizedlist>
<para>The following code portion demonstrates using a drawing
area to display a circle in the normal widget foreground
color.</para>
<refsect3><title>Simple GtkDrawingArea usage</title><informalexample><programlisting role="example"><![CDATA[
void
draw_function (GtkDrawingArea *area, cairo_t *cr,
               int width, int height,
               gpointer data)
{
  GdkRGBA color;
  GtkStyleContext *context;

  context = gtk_widget_get_style_context (GTK_WIDGET (area));

  cairo_arc (cr,
             width / 2.0, height / 2.0,
             MIN (width, height) / 2.0,
             0, 2 * G_PI);

  gtk_style_context_get_color (context,
                               &color);
  gdk_cairo_set_source_rgba (cr, &color);

  cairo_fill (cr);
}

void main (int argc, char **argv)
{
  gtk_init ();

  GtkWidget *area = gtk_drawing_area_new ();
  gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (area), 100);
  gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (area), 100);
  gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (area),
                                  draw_function,
                                  NULL, NULL);

}
]]></programlisting></informalexample>
<para></para>
<para>The draw function is normally called when a drawing area first comes
onscreen, or when it’s covered by another window and then uncovered.
You can also force a redraw by adding to the “damage region” of the
drawing area’s window using <link linkend="gtk-widget-queue-draw"><function>gtk_widget_queue_draw()</function></link>.
This will cause the drawing area to call the draw function again.</para>
<para>The available routines for drawing are documented on the
<link linkend="gdk3-Cairo-Interaction">GDK Drawing Primitives</link> page
and the cairo documentation.</para>
<para>To receive mouse events on a drawing area, you will need to enable
them with <link linkend="gtk-widget-add-events"><function>gtk_widget_add_events()</function></link>. To receive keyboard events, you
will need to set the “can-focus” property on the drawing area, and you
should probably draw some user-visible indication that the drawing
area is focused. Use <link linkend="gtk-widget-has-focus"><function>gtk_widget_has_focus()</function></link> in your expose event
handler to decide whether to draw the focus indicator. See
<link linkend="gtk-render-focus"><function>gtk_render_focus()</function></link> for one way to draw focus.</para>
<para>If you need more complex control over your widget, you should consider
creating your own <link linkend="GtkWidget"><type>GtkWidget</type></link> subclass.</para>
</refsect3>

</refsect1>
<refsect1 id="GtkDrawingArea.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gtk-drawing-area-new" role="function">
<title>gtk_drawing_area_new&#160;()</title>
<indexterm zone="gtk-drawing-area-new"><primary>gtk_drawing_area_new</primary></indexterm>
<programlisting language="C"><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link>&#160;*
gtk_drawing_area_new (<parameter><type>void</type></parameter>);</programlisting>
<para>Creates a new drawing area.</para>
<refsect3 id="gtk-drawing-area-new.returns" role="returns">
<title>Returns</title>
<para> a new <link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link></para>
</refsect3></refsect2>
<refsect2 id="gtk-drawing-area-get-content-width" role="function">
<title>gtk_drawing_area_get_content_width&#160;()</title>
<indexterm zone="gtk-drawing-area-get-content-width"><primary>gtk_drawing_area_get_content_width</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gtk_drawing_area_get_content_width (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *self</parameter>);</programlisting>
<para>Retrieves the value previously set via <link linkend="gtk-drawing-area-set-content-width"><function>gtk_drawing_area_set_content_width()</function></link>.</para>
<refsect3 id="gtk-drawing-area-get-content-width.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="GtkDrawingArea"><type>GtkDrawingArea</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drawing-area-get-content-width.returns" role="returns">
<title>Returns</title>
<para> The width requested for content of the drawing area</para>
</refsect3></refsect2>
<refsect2 id="gtk-drawing-area-set-content-width" role="function">
<title>gtk_drawing_area_set_content_width&#160;()</title>
<indexterm zone="gtk-drawing-area-set-content-width"><primary>gtk_drawing_area_set_content_width</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drawing_area_set_content_width (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *self</parameter>,
                                    <parameter><link linkend="int"><type>int</type></link> width</parameter>);</programlisting>
<para>Sets the desired width of the contents of the drawing area. Note that
because widgets may be allocated larger sizes than they requested, it is
possible that the actual width passed to your draw function is larger
than the width set here. You can use <link linkend="gtk-widget-set-halign"><function>gtk_widget_set_halign()</function></link> to avoid
that.</para>
<para>If the width is set to 0 (the default), the drawing area may disappear.</para>
<refsect3 id="gtk-drawing-area-set-content-width.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="GtkDrawingArea"><type>GtkDrawingArea</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the width of contents</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drawing-area-get-content-height" role="function">
<title>gtk_drawing_area_get_content_height&#160;()</title>
<indexterm zone="gtk-drawing-area-get-content-height"><primary>gtk_drawing_area_get_content_height</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gtk_drawing_area_get_content_height (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *self</parameter>);</programlisting>
<para>Retrieves the value previously set via <link linkend="gtk-drawing-area-set-content-height"><function>gtk_drawing_area_set_content_height()</function></link>.</para>
<refsect3 id="gtk-drawing-area-get-content-height.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="GtkDrawingArea"><type>GtkDrawingArea</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gtk-drawing-area-get-content-height.returns" role="returns">
<title>Returns</title>
<para> The height requested for content of the drawing area</para>
</refsect3></refsect2>
<refsect2 id="gtk-drawing-area-set-content-height" role="function">
<title>gtk_drawing_area_set_content_height&#160;()</title>
<indexterm zone="gtk-drawing-area-set-content-height"><primary>gtk_drawing_area_set_content_height</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drawing_area_set_content_height (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *self</parameter>,
                                     <parameter><link linkend="int"><type>int</type></link> height</parameter>);</programlisting>
<para>Sets the desired height of the contents of the drawing area. Note that
because widgets may be allocated larger sizes than they requested, it is
possible that the actual height passed to your draw function is larger
than the height set here. You can use <link linkend="gtk-widget-set-valign"><function>gtk_widget_set_valign()</function></link> to avoid
that.</para>
<para>If the height is set to 0 (the default), the drawing area may disappear.</para>
<refsect3 id="gtk-drawing-area-set-content-height.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="GtkDrawingArea"><type>GtkDrawingArea</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the height of contents</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="GtkDrawingAreaDrawFunc" role="function">
<title>GtkDrawingAreaDrawFunc&#160;()</title>
<indexterm zone="GtkDrawingAreaDrawFunc"><primary>GtkDrawingAreaDrawFunc</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
<phrase role="c_punctuation">(</phrase>*GtkDrawingAreaDrawFunc<phrase role="c_punctuation">)</phrase> (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *drawing_area</parameter>,
                           <parameter><link linkend="cairo-t"><type>cairo_t</type></link> *cr</parameter>,
                           <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                           <parameter><link linkend="int"><type>int</type></link> height</parameter>,
                           <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>);</programlisting>
<para>Whenever <parameter>drawing_area</parameter>
 needs to redraw, this function will be called.</para>
<para>This function should exclusively redraw the contents of the drawing area
and must not call any widget functions that cause changes.</para>
<refsect3 id="GtkDrawingAreaDrawFunc.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>drawing_area</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> to redraw</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>cr</para></entry>
<entry role="parameter_description"><para>the context to draw to</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the actual width of the contents. This value will be at least
as wide as GtkDrawingArea:width.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the actual height of the contents. This value will be at least
as wide as GtkDrawingArea:height.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>user data. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gtk-drawing-area-set-draw-func" role="function">
<title>gtk_drawing_area_set_draw_func&#160;()</title>
<indexterm zone="gtk-drawing-area-set-draw-func"><primary>gtk_drawing_area_set_draw_func</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gtk_drawing_area_set_draw_func (<parameter><link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *self</parameter>,
                                <parameter><link linkend="GtkDrawingAreaDrawFunc"><type>GtkDrawingAreaDrawFunc</type></link> draw_func</parameter>,
                                <parameter><link linkend="gpointer"><type>gpointer</type></link> user_data</parameter>,
                                <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> destroy</parameter>);</programlisting>
<para>Setting a draw function is the main thing you want to do when using a drawing
area. It is called whenever GTK needs to draw the contents of the drawing area
to the screen.</para>
<para>The draw function will be called during the drawing stage of GTK. In the
drawing stage it is not allowed to change properties of any GTK widgets or call
any functions that would cause any properties to be changed.
You should restrict yourself exclusively to drawing your contents in the draw
function.</para>
<para>If what you are drawing does change, call <link linkend="gtk-widget-queue-draw"><function>gtk_widget_queue_draw()</function></link> on the
drawing area. This will cause a redraw and will call <parameter>draw_func</parameter>
 again.</para>
<refsect3 id="gtk-drawing-area-set-draw-func.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="GtkDrawingArea"><type>GtkDrawingArea</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>draw_func</para></entry>
<entry role="parameter_description"><para>callback that lets you draw
the drawing area's contents. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>user_data</para></entry>
<entry role="parameter_description"><para>user data passed to <parameter>draw_func</parameter>
. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>closure</acronym>]</emphasis></entry></row>
<row><entry role="parameter_name"><para>destroy</para></entry>
<entry role="parameter_description"><para>destroy notifier for <parameter>user_data</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GtkDrawingArea.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GtkDrawingArea--content-height" role="property"><title>The <literal>“content-height”</literal> property</title>
<indexterm zone="GtkDrawingArea--content-height"><primary>GtkDrawingArea:content-height</primary></indexterm>
<programlisting>  “content-height”           <link linkend="gint"><type>gint</type></link></programlisting>
<para>The content height. See <link linkend="gtk-drawing-area-set-content-height"><function>gtk_drawing_area_set_content_height()</function></link> for details.</para>
<para>Owner: GtkDrawingArea</para>
<para>Flags: Read / Write</para>
<para>Allowed values: &gt;= 0</para>
<para>Default value: 0</para>
</refsect2>
<refsect2 id="GtkDrawingArea--content-width" role="property"><title>The <literal>“content-width”</literal> property</title>
<indexterm zone="GtkDrawingArea--content-width"><primary>GtkDrawingArea:content-width</primary></indexterm>
<programlisting>  “content-width”            <link linkend="gint"><type>gint</type></link></programlisting>
<para>The content width. See <link linkend="gtk-drawing-area-set-content-width"><function>gtk_drawing_area_set_content_width()</function></link> for details.</para>
<para>Owner: GtkDrawingArea</para>
<para>Flags: Read / Write</para>
<para>Allowed values: &gt;= 0</para>
<para>Default value: 0</para>
</refsect2>

</refsect1>
<refsect1 id="GtkDrawingArea.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GtkDrawingArea-resize" role="signal"><title>The <literal>“resize”</literal> signal</title>
<indexterm zone="GtkDrawingArea-resize"><primary>GtkDrawingArea::resize</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> *area,
               <link linkend="gint"><type>gint</type></link>            width,
               <link linkend="gint"><type>gint</type></link>            height,
               <link linkend="gpointer"><type>gpointer</type></link>        user_data)</programlisting>
<para>The ::resize signal is emitted once when the widget is realized, and
then each time the widget is changed while realized. This is useful
in order to keep state up to date with the widget size, like for
instance a backing surface.</para>
<refsect3 id="GtkDrawingArea-resize.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>area</para></entry>
<entry role="parameter_description"><para>the <link linkend="GtkDrawingArea"><type>GtkDrawingArea</type></link> that emitted the signal</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the width of the viewport</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the height of the viewport</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><simpara>user_data</simpara></entry>
<entry role="parameter_description"><simpara>user data set when the signal handler was connected.</simpara></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para>Flags: <link linkend="G-SIGNAL-RUN-LAST:CAPS">Run Last</link></para>
</refsect2>
</refsect1>
<refsect1 id="GtkDrawingArea.see-also">
<title>See Also</title>
<para><link linkend="GtkImage"><type>GtkImage</type></link></para>

</refsect1>

</refentry>
