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
|
<?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="GimpFileEntry">
<refmeta>
<refentrytitle id="top_of_page">GimpFileEntry</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMPWIDGETS Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>GimpFileEntry</refname>
<refpurpose>Widget for entering a filename.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv id="synopsis">
<title id="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="GimpFileEntry-struct">GimpFileEntry</link>;
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="gimp-file-entry-new">gimp_file_entry_new</link> (const <link linkend="gchar">gchar</link> *title,
const <link linkend="gchar">gchar</link> *filename,
<link linkend="gboolean">gboolean</link> dir_only,
<link linkend="gboolean">gboolean</link> check_valid);
<link linkend="gchar">gchar</link>* <link linkend="gimp-file-entry-get-filename">gimp_file_entry_get_filename</link> (<link linkend="GimpFileEntry">GimpFileEntry</link> *entry);
<link linkend="void">void</link> <link linkend="gimp-file-entry-set-filename">gimp_file_entry_set_filename</link> (<link linkend="GimpFileEntry">GimpFileEntry</link> *entry,
const <link linkend="gchar">gchar</link> *filename);
</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="GtkBox">GtkBox</link>
+----<link linkend="GtkHBox">GtkHBox</link>
+----GimpFileEntry
</synopsis>
</refsect1>
<refsect1 id="impl_interfaces">
<title id="impl_interfaces.title">Implemented Interfaces</title>
<para>
GimpFileEntry implements
<link linkend="AtkImplementorIface">AtkImplementorIface</link>.</para>
</refsect1>
<refsect1 id="signal_proto">
<title id="signal_proto.title">Signals</title>
<synopsis>
"<link linkend="GimpFileEntry-filename-changed">filename-changed</link>"
<link linkend="void">void</link> user_function (<link linkend="GimpFileEntry">GimpFileEntry</link> *arg0,
<link linkend="gpointer">gpointer</link> user_data) : Run first
</synopsis>
</refsect1>
<refsect1 id="desc">
<title id="desc.title">Description</title>
<para>
This widget is used to enter filenames or directories.
</para>
<para>
There is a <link linkend="GtkEntry"><type>GtkEntry</type></link> for entering the filename manually and a "..."
button which will pop up a <link linkend="GtkFileSelection"><type>GtkFileSelection</type></link> dialog.
</para>
<para>
You can restrict the <link linkend="GimpFileSelection"><type>GimpFileSelection</type></link> to directories. In this case
the filename listbox of the <link linkend="GtkFileSelection"><type>GtkFileSelection</type></link> dialog will be hidden.
</para>
<para>
If you specify <parameter>check_valid</parameter> as <link linkend="TRUE:CAPS"><type>TRUE</type></link> in <link linkend="gimp-file-entry-new"><function>gimp_file_entry_new()</function></link>
the entered filename will be checked for validity and a pixmap will be
shown which indicates if the file exists or not.
</para>
<para>
Whenever the user changes the filename, the "filename_changed" signal
will be emitted.
</para>
</refsect1>
<refsect1 id="details">
<title id="details.title">Details</title>
<refsect2>
<title><anchor id="GimpFileEntry-struct" role="struct"/>GimpFileEntry</title>
<indexterm><primary>GimpFileEntry</primary></indexterm><programlisting>typedef struct _GimpFileEntry GimpFileEntry;</programlisting>
<para>
</para></refsect2>
<refsect2>
<title><anchor id="gimp-file-entry-new" role="function"/>gimp_file_entry_new ()</title>
<indexterm><primary>gimp_file_entry_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* gimp_file_entry_new (const <link linkend="gchar">gchar</link> *title,
const <link linkend="gchar">gchar</link> *filename,
<link linkend="gboolean">gboolean</link> dir_only,
<link linkend="gboolean">gboolean</link> check_valid);</programlisting>
<para>
Creates a new <link linkend="GimpFileEntry"><type>GimpFileEntry</type></link> widget.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>title</parameter> :</term>
<listitem><simpara> The title of the <link linkend="GtkFileEntry"><type>GtkFileEntry</type></link> dialog.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter> :</term>
<listitem><simpara> The initial filename.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dir_only</parameter> :</term>
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the file entry should accept directories only.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>check_valid</parameter> :</term>
<listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the widget should check if the entered file
really exists.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> A pointer to the new <link linkend="GimpFileEntry"><type>GimpFileEntry</type></link> widget.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-file-entry-get-filename" role="function"/>gimp_file_entry_get_filename ()</title>
<indexterm><primary>gimp_file_entry_get_filename</primary></indexterm><programlisting><link linkend="gchar">gchar</link>* gimp_file_entry_get_filename (<link linkend="GimpFileEntry">GimpFileEntry</link> *entry);</programlisting>
<para>
Note that you have to <link linkend="g-free"><function>g_free()</function></link> the returned string.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>entry</parameter> :</term>
<listitem><simpara> The file entry you want to know the filename from.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> The file or directory the user has entered.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-file-entry-set-filename" role="function"/>gimp_file_entry_set_filename ()</title>
<indexterm><primary>gimp_file_entry_set_filename</primary></indexterm><programlisting><link linkend="void">void</link> gimp_file_entry_set_filename (<link linkend="GimpFileEntry">GimpFileEntry</link> *entry,
const <link linkend="gchar">gchar</link> *filename);</programlisting>
<para>
If you specified <parameter>check_valid</parameter> as <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> in <link linkend="gimp-file-entry-new"><function>gimp_file_entry_new()</function></link>
the <link linkend="GimpFileEntry"><type>GimpFileEntry</type></link> will immediately check the validity of the file
name.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>entry</parameter> :</term>
<listitem><simpara> The file entry you want to set the filename for.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>filename</parameter> :</term>
<listitem><simpara> The new filename.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1 id="signals">
<title id="signals.title">Signal Details</title>
<refsect2><title><anchor id="GimpFileEntry-filename-changed"/>The "filename-changed" signal</title>
<indexterm><primary>GimpFileEntry::filename-changed</primary></indexterm><programlisting><link linkend="void">void</link> user_function (<link linkend="GimpFileEntry">GimpFileEntry</link> *arg0,
<link linkend="gpointer">gpointer</link> user_data) : Run first</programlisting>
<para>
This signal is emitted whenever the user changes the filename.</para>
<para>
</para><variablelist role="params">
<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>
<link linkend="GimpPathEditor"><type>GimpPathEditor</type></link>
</para>
</refsect1>
</refentry>
|