1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<refentry id="GimpChainButton">
<refmeta>
<refentrytitle id="top_of_page">GimpChainButton</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMPWIDGETS Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GimpChainButton</refname>
<refpurpose>Widget to visually connect two entry widgets.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="synopsis">
<title id="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="GimpChainButton-struct">GimpChainButton</link>;
enum <link linkend="GimpChainPosition">GimpChainPosition</link>;
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="gimp-chain-button-new">gimp_chain_button_new</link> (<link linkend="GimpChainPosition">GimpChainPosition</link> position);
<link linkend="void">void</link> <link linkend="gimp-chain-button-set-active">gimp_chain_button_set_active</link> (<link linkend="GimpChainButton">GimpChainButton</link> *button,
<link linkend="gboolean">gboolean</link> active);
<link linkend="gboolean">gboolean</link> <link linkend="gimp-chain-button-get-active">gimp_chain_button_get_active</link> (<link linkend="GimpChainButton">GimpChainButton</link> *button);
</synopsis>
</refsynopsisdiv>
<refsect1 id="object_hierarchy">
<title id="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
<link linkend="GObject">GObject</link>
+----<link linkend="GInitiallyUnowned">GInitiallyUnowned</link>
+----<link linkend="GtkObject">GtkObject</link>
+----<link linkend="GtkWidget">GtkWidget</link>
+----<link linkend="GtkContainer">GtkContainer</link>
+----<link linkend="GtkTable">GtkTable</link>
+----GimpChainButton
</synopsis>
</refsect1>
<refsect1 id="impl_interfaces">
<title id="impl_interfaces.title">Implemented Interfaces</title>
<para>
GimpChainButton implements
<link linkend="AtkImplementorIface">AtkImplementorIface</link>.</para>
</refsect1>
<refsect1 id="signal_proto">
<title id="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="GimpChainButton-toggled">toggled</link>" <link linkend="void">void</link> user_function (<link linkend="GimpChainButton">GimpChainButton</link> *gimpchainbutton,
<link linkend="gpointer">gpointer</link> user_data) : Run first
</synopsis>
</refsect1>
<refsect1 id="desc">
<title id="desc.title">Description</title>
<para>
This widget provides a button showing either a linked or a broken
chain that can be used to link two entries, spinbuttons, colors
or other GUI elements and show that they may be locked. Use it for
example to connect X and Y ratios to provide the possibility of a
constrained aspect ratio.
</para>
<para>
The <link linkend="GimpChainButton"><type>GimpChainButton</type></link> only gives visual feedback, it does not really
connect widgets. You have to take care of locking the values yourself
by checking the state of the <link linkend="GimpChainButton"><type>GimpChainButton</type></link> whenever a value changes
in one of the connected widgets and adjusting the other value if
necessary.
</para>
</refsect1>
<refsect1 id="details">
<title id="details.title">Details</title>
<refsect2>
<title><anchor id="GimpChainButton-struct" role="struct"/>GimpChainButton</title>
<indexterm><primary>GimpChainButton</primary></indexterm><programlisting>typedef struct _GimpChainButton GimpChainButton;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="GimpChainPosition" role="enum"/>enum GimpChainPosition</title>
<indexterm><primary>GimpChainPosition</primary></indexterm><programlisting>typedef enum
{
GIMP_CHAIN_TOP,
GIMP_CHAIN_LEFT,
GIMP_CHAIN_BOTTOM,
GIMP_CHAIN_RIGHT
} GimpChainPosition;
</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="gimp-chain-button-new" role="function"/>gimp_chain_button_new ()</title>
<indexterm><primary>gimp_chain_button_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* gimp_chain_button_new (<link linkend="GimpChainPosition">GimpChainPosition</link> position);</programlisting>
<para>
Creates a new <link linkend="GimpChainButton"><type>GimpChainButton</type></link> widget.
</para>
<para>
This returns a button showing either a broken or a linked chain and
small clamps attached to both sides that visually group the two widgets
you want to connect. This widget looks best when attached
to a table taking up two columns (or rows respectively) next
to the widgets that it is supposed to connect. It may work
for more than two widgets, but the look is optimized for two.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>position</parameter> :</term>
<listitem><simpara> The position you are going to use for the button
with respect to the widgets you want to chain.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> Pointer to the new <link linkend="GimpChainButton"><type>GimpChainButton</type></link>, which is inactive
by default. Use <link linkend="gimp-chain-button-set-active"><function>gimp_chain_button_set_active()</function></link> to
change its state.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-chain-button-set-active" role="function"/>gimp_chain_button_set_active ()</title>
<indexterm><primary>gimp_chain_button_set_active</primary></indexterm><programlisting><link linkend="void">void</link> gimp_chain_button_set_active (<link linkend="GimpChainButton">GimpChainButton</link> *button,
<link linkend="gboolean">gboolean</link> active);</programlisting>
<para>
Sets the state of the <link linkend="GimpChainButton"><type>GimpChainButton</type></link> to be either locked (<link linkend="TRUE:CAPS"><literal>TRUE</literal></link>) or
unlocked (<link linkend="FALSE:CAPS"><literal>FALSE</literal></link>) and changes the showed pixmap to reflect the new state.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter> :</term>
<listitem><simpara> Pointer to a <link linkend="GimpChainButton"><type>GimpChainButton</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>active</parameter> :</term>
<listitem><simpara> The new state.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-chain-button-get-active" role="function"/>gimp_chain_button_get_active ()</title>
<indexterm><primary>gimp_chain_button_get_active</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link> gimp_chain_button_get_active (<link linkend="GimpChainButton">GimpChainButton</link> *button);</programlisting>
<para>
Checks the state of the <link linkend="GimpChainButton"><type>GimpChainButton</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>button</parameter> :</term>
<listitem><simpara> Pointer to a <link linkend="GimpChainButton"><type>GimpChainButton</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the <link linkend="GimpChainButton"><type>GimpChainButton</type></link> is active (locked).
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="signals">
<title id="signals.title">Signal Details</title>
<refsect2><title><anchor id="GimpChainButton-toggled"/>The "toggled" signal</title>
<indexterm><primary>GimpChainButton::toggled</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GimpChainButton">GimpChainButton</link> *gimpchainbutton,
<link linkend="gpointer">gpointer</link> user_data) : Run first</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gimpchainbutton</parameter> :</term>
<listitem><simpara>the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter> :</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
You may want to use the convenience function <link linkend="gimp-coordinates-new"><function>gimp_coordinates_new()</function></link> to set
up two GimpSizeEntries (see <link linkend="GimpSizeEntry"><type>GimpSizeEntry</type></link>) linked with a <link linkend="GimpChainButton"><type>GimpChainButton</type></link>.
</para>
</refsect1>
</refentry>
|