1 <refentry id="gtk-running" revision="10 Jan 2002">
3 <refentrytitle>Running GTK+ Applications</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GTK Library</refmiscinfo>
9 <refname>Running GTK+ Applications</refname>
11 How to run and debug your GTK+ application
16 <title>Running and debugging GTK+ Applications</title>
19 <title>Common commandline options</title>
22 All GTK+ applications support a number of standard commandline
23 options. These are removed from <literal>argv</literal> by <link
24 linkend="gtk-init">gtk_init()</link>. Modules may parse and remove
29 <title><systemitem>--gtk-module <replaceable>module</replaceable></systemitem></title>
32 A list of modules to load in addition to those specified in the
33 <envar>GTK_MODULES</envar> environment variable.
38 <title><systemitem>--g-fatal-warnings</systemitem></title>
41 Make GTK+ abort on all warnings. This is useful to stop on the first
42 warning in a debugger, if your application is printing multiple
43 warnings. It's almost always best to start debugging with the first
49 <title><systemitem>--gtk-debug <replaceable>options</replaceable></systemitem></title>
52 A list of <link linkend="GTK-Debug-Options">debug options</link>
53 to turn on in addition to those specified in the <envar>GTK_DEBUG</envar>
55 This option is only available if GTK+ has been configured with
56 <option>--enable-debug=yes</option>.
61 <title><systemitem>--gtk-no-debug <replaceable>options</replaceable></systemitem></title>
64 A list of <link linkend="GTK-Debug-Options">debug options</link>
66 This option is only available if GTK+ has been configured with
67 <option>--enable-debug=yes</option>.
72 The following options are really used by GDK, not by GTK+, but we
73 list them here for completeness nevertheless.
77 <title><systemitem>--class <replaceable>class</replaceable></systemitem></title>
80 Sets the program class; see gdk_set_program_class().
85 <title><systemitem>--name <replaceable>name</replaceable></systemitem></title>
88 Sets the program name.
93 <title><systemitem>--gdk-debug <replaceable>options</replaceable></systemitem></title>
96 A list of <link linkend="GDK-Debug-Options">debug options</link>
97 to turn on in addition to those
98 specified in the <envar>GDK_DEBUG</envar> environment variable.
99 This option is only available if GTK+ has been configured with
100 <option>--enable-debug=yes</option>.
105 <title><systemitem>--gdk-no-debug <replaceable>options</replaceable></systemitem></title>
108 A list of <link linkend="GDK-Debug-Options">debug options</link>
110 This option is only available if GTK+ has been configured with
111 <option>--enable-debug=yes</option>.
116 <title><systemitem>--display <replaceable>display</replaceable></systemitem></title>
119 The name of the X display to open instead of the one specified
120 in the <envar>DISPLAY</envar>.
121 This option is only available if GTK+ has been configured with
122 <option>--gdk-target=x11</option>.
127 <title><systemitem>--sync</systemitem></title>
130 Makes all X requests synchronously. This is a useful option for
131 debugging, but it will slow down the performance considerably.
132 This option is only available if GTK+ has been configured with
133 <option>--gdk-target=x11</option>.
138 <title><systemitem>--gxid-host <replaceable>host</replaceable></systemitem></title>
141 The host to contact the <application>gxid</application> daemon on; overwrites
142 the <link linkend="GXID"><envar>GXID_HOST</envar></link> environment variable.
143 This option is only available if GTK+ has been configured with
144 <option>--gdk-target=x11</option>.
149 <title><systemitem>--gxid-port <replaceable>port</replaceable></systemitem></title>
152 The port for the connection to <application>gxid</application>; overwrites
153 the <link linkend="GXID"><envar>GXID_PORT</envar></link> environment variable.
154 This option is only available if GTK+ has been configured with
155 <option>--gdk-target=x11</option>.
162 <title>Environment variables</title>
165 GTK+ inspects a number of environment variables in addition to standard
166 variables like <envar>LANG</envar>, <envar>PATH</envar>, <envar>HOME</envar>
167 or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
170 <formalpara id="GTK-Debug-Options">
171 <title><envar>GTK_DEBUG</envar></title>
174 If GTK+ has been configured with <option>--enable-debug=yes</option>,
175 this variable can be set to a list of debug options, which cause GTK+
176 to print out different types of debugging information.
180 <listitem><para>Miscellaneous information</para></listitem>
184 <listitem><para>Information about text widget internals</para></listitem>
188 <listitem><para>Information about tree widget internals</para></listitem>
192 <listitem><para>Visual feedback about window updates</para></listitem>
195 The special value <literal>all</literal> can be used to turn on all debug options.
200 <title><envar>GTK_MODULES</envar></title>
203 A list of modules to load.
208 <title><envar>GTK_PATH</envar></title>
211 Specifies a list of directories to search when GTK+ is looking for
212 dynamically loaded objects such as the modules specified by
213 <envar>GTK_MODULES</envar>, theme engines, and input method
214 modules. If the path to the dynamically loaded object is given
215 as an absolute path name, then GTK+ loads it directly. Otherwise,
216 GTK+ goes in turn through the directories in GTK_PATH, followed
217 by the directory <filename>.gtk-2.0</filename> in the user's home
218 directory, followed by the system default directory,
219 which is <filename><replaceable>libdir</replaceable>/gtk-2.0/modules</filename>.
220 (If <envar>GTK_EXE_PREFIX</envar> is defined, <replaceable>libdir</replaceable> is
221 <filename>$GTK_EXE_PREFIX/lib</filename>. Otherwise it is the libdir
222 specified when GTK+ was configured, usually
223 <filename>/usr/lib</filename>, or
224 <filename>/usr/local/lib</filename>.)
225 For each directory in this list, GTK+ actually looks in a
227 <filename><replaceable>directory</replaceable>/<replaceable>version</replaceable>/<replaceable>host</replaceable>/<replaceable>type</replaceable></filename>
228 Where <replaceable>version</replaceable> is derived from the
229 version of GTK+ (use <literal>pkg-config
230 --variable=gtk_binary_version gtk+-2.0</literal> to determine this from a
231 script), <replaceable>host</replaceable> is the architecture on
232 which GTK+ was built. (use <literal>pkg-config
233 --variable=gtk_host gtk+-2.0</literal> to determine this from a
234 script), and <replaceable>type</replaceable> is a directory
235 specific to the type of modules; currently it can be
236 <literal>modules</literal>, <literal>engines</literal> or
237 <literal>immodules</literal> corresponding to the three types of
238 modules above. Either <replaceable>version</replaceable>,
239 <replaceable>host</replaceable>, or both may be omitted. GTK+ looks
240 first in the most specific directory, then in directories with
242 The components of GTK_PATH are separated by the ':' character on
243 Linux and Unix, and the ';' character on Windows.
248 <title><envar>GTK_IM_MODULE</envar></title>
251 Specifies an IM module to use in preference to the one determined
256 <formalpara id="im-module-file">
257 <title><envar>GTK_IM_MODULE_FILE</envar></title>
260 Specifies the file listing the IM modules to load. This environment
261 variable overwrites the <literal>im_module_file</literal> specified in
262 the RC files, which in turn overwrites the default value
263 <filename><replaceable>sysconfdir</replaceable>/gtk-2.0/gtk.immodules</filename>
264 (<replaceable>sysconfdir</replaceable> is the sysconfdir specified when GTK+ was configured,
265 usually <filename>/usr/local/etc</filename>.)
270 <title><envar>GTK_RC_FILES</envar></title>
273 Specifies a list of RC files to parse instead of the default ones;
274 see <link linkend="gtk-Resource-Files">Resource Files</link>.
279 <title><envar>GTK_EXE_PREFIX</envar></title>
282 If set, GTK+ uses <filename>$GTK_EXE_PREFIX/lib</filename> instead of
283 the libdir configured when GTK+ was compiled.
288 <title><envar>GTK_DATA_PREFIX</envar></title>
291 If set, makes GTK+ use <filename>$GTK_DATA_PREFIX</filename>
292 instead of the prefix configured when GTK+ was compiled.
297 The following environment variables are used by GdkPixbuf, GDK or
298 Pango, not by GTK+ itself, but we list them here for completeness
303 <title><envar>GDK_PIXBUF_MODULEDIR</envar></title>
306 Specifies the directory to look for GdkPixbuf loader modules.
307 By default, GdkPixbuf looks for its loaders in
308 <filename><replaceable>libdir</replaceable>/gtk-2.0/<replaceable>version</replaceable>/loaders</filename>.
312 <formalpara id="GDK-Debug-Options">
313 <title><envar>GDK_DEBUG</envar></title>
316 If GTK+ has been configured with <option>--enable-debug=yes</option>,
317 this variable can be set to a list of debug options, which cause GDK
318 to print out different types of debugging information.
322 <listitem><para>Miscellaneous information</para></listitem>
326 <listitem><para>Show all events received by GDK</para></listitem>
330 <listitem><para>Information about drag-and-drop</para></listitem>
334 <listitem><para>Information about XIM support</para></listitem>
337 The special value <literal>all</literal> can be used to turn on all debug options.
341 <formalpara id="GXID">
342 <title><envar>GXID_HOST</envar> and <envar>GXID_PORT</envar></title>
345 The host and port to contact the <application>gxid</application> daemon on.
346 <application>gxid</application> is only necessary on X servers which
347 don't support using the pointer and extension devices at once, and is
348 only built if GTK+ is configured with <option>--with-xinput=gxi</option>.
349 The <application>XFree86</application> X servers don't have this
355 <title><envar>GDK_USE_XFT</envar></title>
358 If this variable is set to 1, GTK+ will use the Pango Xft backend instead
359 of the X backend when possible (i.e. when the X server supports the XRender
360 extension and Pango has been built with Xft support).