<?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">
]>
<refentry id="GdkPopup">
<refmeta>
<refentrytitle role="top_of_page" id="GdkPopup.top_of_page">Popups</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Popups</refname>
<refpurpose>Interface for popup surfaces</refpurpose>
</refnamediv>

<refsect1 id="GdkPopup.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="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-popup-present">gdk_popup_present</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkGravity"><returnvalue>GdkGravity</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-popup-get-surface-anchor">gdk_popup_get_surface_anchor</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkGravity"><returnvalue>GdkGravity</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-popup-get-rect-anchor">gdk_popup_get_rect_anchor</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-popup-get-parent">gdk_popup_get_parent</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="gdk-popup-get-position-x">gdk_popup_get_position_x</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="gdk-popup-get-position-y">gdk_popup_get_position_y</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="gdk-popup-get-autohide">gdk_popup_get_autohide</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkPopup.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="gboolean"><type>gboolean</type></link></entry><entry role="property_name"><link linkend="GdkPopup--autohide">autohide</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>
<row><entry role="property_type"><link linkend="GdkSurface"><type>GdkSurface</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkPopup--parent">parent</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkPopup.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="GdkPopup-popup-layout-changed">popup-layout-changed</link></entry><entry role="signal_flags"><link linkend="G-SIGNAL-RUN-FIRST:CAPS">Run First</link></entry></row>

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

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GdkPopup.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GInterface">GInterface</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkPopup
</screen>
</refsect1>
<refsect1 id="GdkPopup.prerequisites" role="prerequisites">
<title role="prerequisites.title">Prerequisites</title>
<para>
GdkPopup requires
 <link linkend="GdkSurface">GdkSurface</link>.</para>

</refsect1>

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

<refsect1 id="GdkPopup.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GdkPopup"><type>GdkPopup</type></link> is a surface that is attached to another surface,
and is positioned relative to it.</para>

</refsect1>
<refsect1 id="GdkPopup.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-popup-present" role="function">
<title>gdk_popup_present&#160;()</title>
<indexterm zone="gdk-popup-present"><primary>gdk_popup_present</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_popup_present (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>,
                   <parameter><link linkend="int"><type>int</type></link> width</parameter>,
                   <parameter><link linkend="int"><type>int</type></link> height</parameter>,
                   <parameter><link linkend="GdkPopupLayout"><type>GdkPopupLayout</type></link> *layout</parameter>);</programlisting>
<para>Present <parameter>popup</parameter>
 after having processed the <link linkend="GdkPopupLayout"><type>GdkPopupLayout</type></link> rules.
If the popup was previously now showing, it will be showed,
otherwise it will change position according to <parameter>layout</parameter>
.</para>
<para>After calling this function, the result of the layout can be queried
using <link linkend="gdk-popup-get-position-x"><function>gdk_popup_get_position_x()</function></link>, <link linkend="gdk-popup-get-position-y"><function>gdk_popup_get_position_y()</function></link>,
<link linkend="gdk-surface-get-width"><function>gdk_surface_get_width()</function></link>, <link linkend="gdk-surface-get-height"><function>gdk_surface_get_height()</function></link>,
<link linkend="gdk-popup-get-rect-anchor"><function>gdk_popup_get_rect_anchor()</function></link> and <link linkend="gdk-popup-get-surface-anchor"><function>gdk_popup_get_surface_anchor()</function></link>.</para>
<para>Presenting may have fail, for example if it was immediately
hidden if the <parameter>popup</parameter>
 was set to autohide.</para>
<refsect3 id="gdk-popup-present.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>popup</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkPopup"><type>GdkPopup</type></link> to show</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>width</para></entry>
<entry role="parameter_description"><para>the unconstrained popup width to layout</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>height</para></entry>
<entry role="parameter_description"><para>the unconstrained popup height to layout</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>layout</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkPopupLayout"><type>GdkPopupLayout</type></link> object used to layout</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-present.returns" role="returns">
<title>Returns</title>
<para> <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if it failed to be presented, otherwise <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>.</para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-surface-anchor" role="function">
<title>gdk_popup_get_surface_anchor&#160;()</title>
<indexterm zone="gdk-popup-get-surface-anchor"><primary>gdk_popup_get_surface_anchor</primary></indexterm>
<programlisting language="C"><link linkend="GdkGravity"><returnvalue>GdkGravity</returnvalue></link>
gdk_popup_get_surface_anchor (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Gets the current popup surface anchor.</para>
<para>The value returned may change after calling <link linkend="gdk-popup-present"><function>gdk_popup_present()</function></link>,
or after the "popup-layout-changed" is emitted.</para>
<refsect3 id="gdk-popup-get-surface-anchor.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-surface-anchor.returns" role="returns">
<title>Returns</title>
<para> the current surface anchor value of <parameter>popup</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-rect-anchor" role="function">
<title>gdk_popup_get_rect_anchor&#160;()</title>
<indexterm zone="gdk-popup-get-rect-anchor"><primary>gdk_popup_get_rect_anchor</primary></indexterm>
<programlisting language="C"><link linkend="GdkGravity"><returnvalue>GdkGravity</returnvalue></link>
gdk_popup_get_rect_anchor (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Gets the current popup rectangle anchor.</para>
<para>The value returned may change after calling <link linkend="gdk-popup-present"><function>gdk_popup_present()</function></link>,
or after the "popup-layout-changed" is emitted.</para>
<refsect3 id="gdk-popup-get-rect-anchor.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-rect-anchor.returns" role="returns">
<title>Returns</title>
<para> the current rectangle anchor value of <parameter>popup</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-parent" role="function">
<title>gdk_popup_get_parent&#160;()</title>
<indexterm zone="gdk-popup-get-parent"><primary>gdk_popup_get_parent</primary></indexterm>
<programlisting language="C"><link linkend="GdkSurface"><returnvalue>GdkSurface</returnvalue></link>&#160;*
gdk_popup_get_parent (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Returns the parent surface of a popup.</para>
<refsect3 id="gdk-popup-get-parent.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-parent.returns" role="returns">
<title>Returns</title>
<para>the parent surface. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-position-x" role="function">
<title>gdk_popup_get_position_x&#160;()</title>
<indexterm zone="gdk-popup-get-position-x"><primary>gdk_popup_get_position_x</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_popup_get_position_x (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Obtains the position of the popup relative to its parent.</para>
<refsect3 id="gdk-popup-get-position-x.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-position-x.returns" role="returns">
<title>Returns</title>
<para> the X coordinate of <parameter>popup</parameter>
position</para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-position-y" role="function">
<title>gdk_popup_get_position_y&#160;()</title>
<indexterm zone="gdk-popup-get-position-y"><primary>gdk_popup_get_position_y</primary></indexterm>
<programlisting language="C"><link linkend="int"><returnvalue>int</returnvalue></link>
gdk_popup_get_position_y (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Obtains the position of the popup relative to its parent.</para>
<refsect3 id="gdk-popup-get-position-y.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-position-y.returns" role="returns">
<title>Returns</title>
<para> the Y coordinate of <parameter>popup</parameter>
position</para>
</refsect3></refsect2>
<refsect2 id="gdk-popup-get-autohide" role="function">
<title>gdk_popup_get_autohide&#160;()</title>
<indexterm zone="gdk-popup-get-autohide"><primary>gdk_popup_get_autohide</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_popup_get_autohide (<parameter><link linkend="GdkPopup"><type>GdkPopup</type></link> *popup</parameter>);</programlisting>
<para>Returns whether this popup is set to hide on outside clicks.</para>
<refsect3 id="gdk-popup-get-autohide.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>popup</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkPopup"><type>GdkPopup</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-popup-get-autohide.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if <parameter>popup</parameter>
will autohide</para>
</refsect3></refsect2>

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

</refsect1>
<refsect1 id="GdkPopup.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkPopup--autohide" role="property"><title>The <literal>“autohide”</literal> property</title>
<indexterm zone="GdkPopup--autohide"><primary>GdkPopup:autohide</primary></indexterm>
<programlisting>  “autohide”                 <link linkend="gboolean"><type>gboolean</type></link></programlisting>
<para>Whether to hide on outside clicks.</para><para>Owner: GdkPopup</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
<para>Default value: FALSE</para>
</refsect2>
<refsect2 id="GdkPopup--parent" role="property"><title>The <literal>“parent”</literal> property</title>
<indexterm zone="GdkPopup--parent"><primary>GdkPopup:parent</primary></indexterm>
<programlisting>  “parent”                   <link linkend="GdkSurface"><type>GdkSurface</type></link>&#160;*</programlisting>
<para>The parent surface.</para><para>Owner: GdkPopup</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
</refsect2>

</refsect1>
<refsect1 id="GdkPopup.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GdkPopup-popup-layout-changed" role="signal"><title>The <literal>“popup-layout-changed”</literal> signal</title>
<indexterm zone="GdkPopup-popup-layout-changed"><primary>GdkPopup::popup-layout-changed</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
user_function (<link linkend="GdkPopup"><type>GdkPopup</type></link> *popup,
               <link linkend="gpointer"><type>gpointer</type></link>  user_data)</programlisting>
<para>Emitted when the layout of a popup surface has changed, e.g. if the popup
layout was reactive and after the parent moved causing the popover to end
up partially off-screen.</para>
<refsect3 id="GdkPopup-popup-layout-changed.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>popup</para></entry>
<entry role="parameter_description"><para>the <link linkend="GdkSurface"><type>GdkSurface</type></link> that was laid out</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-FIRST:CAPS">Run First</link></para>
</refsect2>
</refsect1>

</refentry>
