5
by JazzyNico
Adding gtk2 libraries. |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2 |
<html> |
|
3 |
<head> |
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|
5 |
<title>Running GTK+ Applications</title> |
|
6 |
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1"> |
|
7 |
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual"> |
|
8 |
<link rel="up" href="gtk.html" title="Part I. GTK+ Overview"> |
|
9 |
<link rel="prev" href="gtk-compiling.html" title="Compiling GTK+ Applications"> |
|
10 |
<link rel="next" href="gtk-x11.html" title="Using GTK+ on the X Window System"> |
|
11 |
<meta name="generator" content="GTK-Doc V1.18 (XML mode)"> |
|
12 |
<link rel="stylesheet" href="style.css" type="text/css"> |
|
13 |
</head> |
|
14 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
|
15 |
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"> |
|
16 |
<td><a accesskey="p" href="gtk-compiling.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> |
|
17 |
<td><a accesskey="u" href="gtk.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> |
|
18 |
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> |
|
19 |
<th width="100%" align="center">GTK+ 2 Reference Manual</th> |
|
20 |
<td><a accesskey="n" href="gtk-x11.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> |
|
21 |
</tr></table> |
|
22 |
<div class="refentry"> |
|
23 |
<a name="gtk-running"></a><div class="titlepage"></div> |
|
24 |
<div class="refnamediv"><table width="100%"><tr> |
|
25 |
<td valign="top"> |
|
26 |
<h2><span class="refentrytitle">Running GTK+ Applications</span></h2> |
|
27 |
<p>Running GTK+ Applications — |
|
28 |
How to run and debug your GTK+ application |
|
29 |
</p> |
|
30 |
</td> |
|
31 |
<td valign="top" align="right"></td> |
|
32 |
</tr></table></div> |
|
33 |
<div class="refsect1"> |
|
34 |
<a name="idp2037584"></a><h2>Running and debugging GTK+ Applications</h2> |
|
35 |
<div class="refsect2"> |
|
36 |
<a name="idp8626912"></a><h3>Common commandline options</h3> |
|
37 |
<p> |
|
38 |
All GTK+ applications support a number of standard commandline |
|
39 |
options. These are removed from <code class="literal">argv</code> by gtk_init(). |
|
40 |
Modules may parse and remove further options. The |
|
41 |
<a class="link" href="gtk-x11.html#x11-cmdline" title="X11-specific commandline options">X11</a> and |
|
42 |
<a class="link" href="gtk-windows.html#win32-cmdline" title="Windows-specific commandline options">Windows</a> GDK backends parse |
|
43 |
some additional commandline options. |
|
44 |
</p> |
|
45 |
<p><b><code class="systemitem">--gtk-module <em class="replaceable"><code>module</code></em></code>. </b> |
|
46 |
A list of modules to load in addition to those specified in the |
|
47 |
<code class="envar">GTK_MODULES</code> environment variable and the |
|
48 |
<code class="literal">gtk-modules</code> setting. |
|
49 |
</p> |
|
50 |
<p><b><code class="systemitem">--g-fatal-warnings</code>. </b> |
|
51 |
Make GTK+ abort on all warnings. This is useful to stop on the first |
|
52 |
warning in a debugger, if your application is printing multiple |
|
53 |
warnings. It's almost always best to start debugging with the first |
|
54 |
warning that occurs. |
|
55 |
</p> |
|
56 |
<p><b><code class="systemitem">--gtk-debug <em class="replaceable"><code>options</code></em></code>. </b> |
|
57 |
A list of <a class="link" href="gtk-running.html#GTK-Debug-Options" title="GTK_DEBUG">debug options</a> |
|
58 |
to turn on in addition to those specified in the <code class="envar">GTK_DEBUG</code> |
|
59 |
environment variable. |
|
60 |
This option is only available if GTK+ has been configured with |
|
61 |
<code class="option">--enable-debug=yes</code>. |
|
62 |
</p> |
|
63 |
<p><b><code class="systemitem">--gtk-no-debug <em class="replaceable"><code>options</code></em></code>. </b> |
|
64 |
A list of <a class="link" href="gtk-running.html#GTK-Debug-Options" title="GTK_DEBUG">debug options</a> |
|
65 |
to turn off. |
|
66 |
This option is only available if GTK+ has been configured with |
|
67 |
<code class="option">--enable-debug=yes</code>. |
|
68 |
</p> |
|
69 |
<p> |
|
70 |
The following options are really used by GDK, not by GTK+, but we |
|
71 |
list them here for completeness nevertheless. |
|
72 |
</p> |
|
73 |
<p><b><code class="systemitem">--class <em class="replaceable"><code>class</code></em></code>. </b> |
|
74 |
Sets the program class; see gdk_set_program_class(). |
|
75 |
</p> |
|
76 |
<p><b><code class="systemitem">--name <em class="replaceable"><code>name</code></em></code>. </b> |
|
77 |
Sets the program name. |
|
78 |
</p> |
|
79 |
<p><b><code class="systemitem">--gdk-debug <em class="replaceable"><code>options</code></em></code>. </b> |
|
80 |
A list of <a class="link" href="gtk-running.html#GDK-Debug-Options" title="GDK_DEBUG">debug options</a> |
|
81 |
to turn on in addition to those specified in the <code class="envar">GDK_DEBUG</code> |
|
82 |
environment variable. This option is only available if GTK+ has been |
|
83 |
configured with <code class="option">--enable-debug=yes</code>. |
|
84 |
</p> |
|
85 |
<p><b><code class="systemitem">--gdk-no-debug <em class="replaceable"><code>options</code></em></code>. </b> |
|
86 |
A list of <a class="link" href="gtk-running.html#GDK-Debug-Options" title="GDK_DEBUG">debug options</a> |
|
87 |
to turn off. This option is only available if GTK+ has been configured with |
|
88 |
<code class="option">--enable-debug=yes</code>. |
|
89 |
</p> |
|
90 |
</div> |
|
91 |
<hr> |
|
92 |
<div class="refsect2"> |
|
93 |
<a name="idp9585792"></a><h3>Environment variables</h3> |
|
94 |
<p> |
|
95 |
GTK+ inspects a number of environment variables in addition to standard |
|
96 |
variables like <code class="envar">LANG</code>, <code class="envar">PATH</code>, <code class="envar">HOME</code> |
|
97 |
or <code class="envar">DISPLAY</code>; mostly to determine paths to look for certain |
|
98 |
files. The X11, |
|
99 |
<a class="link" href="gtk-windows.html#win32-envar" title="Windows-specific environment variables">Windows</a> and |
|
100 |
Framebuffer GDK backends use some |
|
101 |
additional environment variables. |
|
102 |
</p> |
|
103 |
<p><a name="GTK-Debug-Options"></a><b><code class="envar">GTK_DEBUG</code>. </b> |
|
104 |
If GTK+ has been configured with <code class="option">--enable-debug=yes</code>, |
|
105 |
this variable can be set to a list of debug options, which cause GTK+ |
|
106 |
to print out different types of debugging information. |
|
107 |
</p> |
|
108 |
<div class="variablelist"><table border="0" class="variablelist"> |
|
109 |
<colgroup> |
|
110 |
<col align="left" valign="top"> |
|
111 |
<col> |
|
112 |
</colgroup> |
|
113 |
<tbody> |
|
114 |
<tr> |
|
115 |
<td><p><span class="term">misc</span></p></td> |
|
116 |
<td><p>Miscellaneous information</p></td> |
|
117 |
</tr> |
|
118 |
<tr> |
|
119 |
<td><p><span class="term">plugsocket</span></p></td> |
|
120 |
<td><p>Cross-process embedding</p></td> |
|
121 |
</tr> |
|
122 |
<tr> |
|
123 |
<td><p><span class="term">text</span></p></td> |
|
124 |
<td><p>Text widget internals</p></td> |
|
125 |
</tr> |
|
126 |
<tr> |
|
127 |
<td><p><span class="term">tree</span></p></td> |
|
128 |
<td><p>Tree widget internals</p></td> |
|
129 |
</tr> |
|
130 |
<tr> |
|
131 |
<td><p><span class="term">updates</span></p></td> |
|
132 |
<td><p>Visual feedback about window updates</p></td> |
|
133 |
</tr> |
|
134 |
<tr> |
|
135 |
<td><p><span class="term">keybindings</span></p></td> |
|
136 |
<td><p>Keybindings</p></td> |
|
137 |
</tr> |
|
138 |
<tr> |
|
139 |
<td><p><span class="term">multihead</span></p></td> |
|
140 |
<td><p>Working on multiple displays</p></td> |
|
141 |
</tr> |
|
142 |
<tr> |
|
143 |
<td><p><span class="term">modules</span></p></td> |
|
144 |
<td><p>Loading of modules</p></td> |
|
145 |
</tr> |
|
146 |
<tr> |
|
147 |
<td><p><span class="term">geometry</span></p></td> |
|
148 |
<td><p>Size allocation</p></td> |
|
149 |
</tr> |
|
150 |
<tr> |
|
151 |
<td><p><span class="term">icontheme</span></p></td> |
|
152 |
<td><p>Icon themes</p></td> |
|
153 |
</tr> |
|
154 |
<tr> |
|
155 |
<td><p><span class="term">printing</span></p></td> |
|
156 |
<td><p>Printing support</p></td> |
|
157 |
</tr> |
|
158 |
<tr> |
|
159 |
<td><p><span class="term">builder</span></p></td> |
|
160 |
<td><p>GtkBuilder support</p></td> |
|
161 |
</tr> |
|
162 |
</tbody> |
|
163 |
</table></div> |
|
164 |
<p> |
|
165 |
The special value <code class="literal">all</code> can be used to turn on all |
|
166 |
debug options. |
|
167 |
</p> |
|
168 |
<p><b><code class="envar">GTK_MODULES</code>. </b> |
|
169 |
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<code class="option">--gtk-module</code>) and with the <code class="literal">gtk-modules</code> setting. |
|
170 |
</p> |
|
171 |
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> |
|
172 |
<h3 class="title">Warning</h3> |
|
173 |
Note that this environment variable is read by GTK+ 3 too, |
|
174 |
which may not have the same set of modules available for loading. |
|
175 |
</div> |
|
176 |
<p><b><code class="envar">GTK_PATH</code>. </b> |
|
177 |
Specifies a list of directories to search when GTK+ is looking for |
|
178 |
dynamically loaded objects such as the modules specified by |
|
179 |
<code class="envar">GTK_MODULES</code>, theme engines, input method |
|
180 |
modules, file system backends and print backends. If the path to |
|
181 |
the dynamically loaded object is given as an absolute path name, |
|
182 |
then GTK+ loads it directly. |
|
183 |
Otherwise, GTK+ goes in turn through the directories in GTK_PATH, |
|
184 |
followed by the directory <code class="filename">.gtk-2.0</code> in the user's |
|
185 |
home directory, followed by the system default directory, |
|
186 |
which is <code class="filename"><em class="replaceable"><code>libdir</code></em>/gtk-2.0/modules</code>. |
|
187 |
(If <code class="envar">GTK_EXE_PREFIX</code> is defined, <em class="replaceable"><code>libdir</code></em> is |
|
188 |
<code class="filename">$GTK_EXE_PREFIX/lib</code>. Otherwise it is the libdir |
|
189 |
specified when GTK+ was configured, usually |
|
190 |
<code class="filename">/usr/lib</code>, or |
|
191 |
<code class="filename">/usr/local/lib</code>.) |
|
192 |
For each directory in this list, GTK+ actually looks in a |
|
193 |
subdirectory |
|
194 |
<code class="filename"><em class="replaceable"><code>directory</code></em>/<em class="replaceable"><code>version</code></em>/<em class="replaceable"><code>host</code></em>/<em class="replaceable"><code>type</code></em></code> |
|
195 |
Where <em class="replaceable"><code>version</code></em> is derived from the |
|
196 |
version of GTK+ (use <code class="literal">pkg-config |
|
197 |
--variable=gtk_binary_version gtk+-2.0</code> to determine this from a |
|
198 |
script), <em class="replaceable"><code>host</code></em> is the architecture on |
|
199 |
which GTK+ was built. (use <code class="literal">pkg-config |
|
200 |
--variable=gtk_host gtk+-2.0</code> to determine this from a |
|
201 |
script), and <em class="replaceable"><code>type</code></em> is a directory |
|
202 |
specific to the type of modules; currently it can be |
|
203 |
<code class="literal">modules</code>, <code class="literal">engines</code>, |
|
204 |
<code class="literal">immodules</code>, <code class="literal">filesystems</code> or |
|
205 |
<code class="literal">printbackends</code>, corresponding to the types of |
|
206 |
modules mentioned above. Either <em class="replaceable"><code>version</code></em>, |
|
207 |
<em class="replaceable"><code>host</code></em>, or both may be omitted. GTK+ looks |
|
208 |
first in the most specific directory, then in directories with |
|
209 |
fewer components. |
|
210 |
The components of GTK_PATH are separated by the ':' character on |
|
211 |
Linux and Unix, and the ';' character on Windows. |
|
212 |
</p> |
|
213 |
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> |
|
214 |
<h3 class="title">Warning</h3> |
|
215 |
Note that this environment variable is read by GTK+ 3 too, which |
|
216 |
makes it unsuitable for setting it system-wide (or session-wide), |
|
217 |
since doing so will cause either GTK+ 2.x applications or GTK+ 3 |
|
218 |
applications to see incompatible modules. |
|
219 |
</div> |
|
220 |
<p><b><code class="envar">GTK_IM_MODULE</code>. </b> |
|
221 |
Specifies an IM module to use in preference to the one determined |
|
222 |
from the locale. If this isn't set and you are running on the system |
|
223 |
that enables <code class="literal">XSETTINGS</code> and has a value in |
|
224 |
<code class="literal">Gtk/IMModule</code>, that will be used for the default |
|
225 |
IM module. |
|
226 |
This also can be a colon-separated list of input-methods, which |
|
227 |
GTK+ will try in turn until it finds one available on the system. |
|
228 |
</p> |
|
229 |
<p><a name="im-module-file"></a><b><code class="envar">GTK_IM_MODULE_FILE</code>. </b> |
|
230 |
Specifies the file listing the IM modules to load. This environment |
|
231 |
variable overrides the <code class="literal">im_module_file</code> specified in |
|
232 |
the RC files, which in turn overrides the default value |
|
233 |
<code class="filename"><em class="replaceable"><code>sysconfdir</code></em>/gtk-2.0/gtk.immodules</code> |
|
234 |
(<em class="replaceable"><code>sysconfdir</code></em> is the sysconfdir specified when GTK+ was configured, |
|
235 |
usually <code class="filename">/usr/local/etc</code>.) |
|
236 |
</p> |
|
237 |
<p><b><code class="envar">GTK2_RC_FILES</code>. </b> |
|
238 |
Specifies a list of RC files to parse instead of the default ones; |
|
239 |
see Resource Files. |
|
240 |
</p> |
|
241 |
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> |
|
242 |
<h3 class="title">Warning</h3> |
|
243 |
Note that this environment variable is read by GTK+ 3 too, which |
|
244 |
makes it unsuitable for setting it system-wide (or session-wide), |
|
245 |
since doing so will cause either GTK+ 2.x applications or GTK+ 3 |
|
246 |
applications to see the wrong list of IM modules. |
|
247 |
</div> |
|
248 |
<p><b><code class="envar">GTK_EXE_PREFIX</code>. </b> |
|
249 |
If set, GTK+ uses <code class="filename">$GTK_EXE_PREFIX/lib</code> instead of |
|
250 |
the libdir configured when GTK+ was compiled. |
|
251 |
</p> |
|
252 |
<p><b><code class="envar">GTK_DATA_PREFIX</code>. </b> |
|
253 |
If set, makes GTK+ use <code class="filename">$GTK_DATA_PREFIX</code> |
|
254 |
instead of the prefix configured when GTK+ was compiled. |
|
255 |
</p> |
|
256 |
<p> |
|
257 |
The following environment variables are used by GdkPixbuf, GDK or |
|
258 |
Pango, not by GTK+ itself, but we list them here for completeness |
|
259 |
nevertheless. |
|
260 |
</p> |
|
261 |
<p><b><code class="envar">GDK_PIXBUF_MODULE_FILE</code>. </b> |
|
262 |
Specifies the file listing the GdkPixbuf loader modules to load. |
|
263 |
This environment variable overrides the default value |
|
264 |
<code class="filename"><em class="replaceable"><code>sysconfdir</code></em>/gtk-2.0/gdk-pixbuf.loaders</code> |
|
265 |
(<em class="replaceable"><code>sysconfdir</code></em> is the sysconfdir specified when |
|
266 |
GTK+ was configured, usually <code class="filename">/usr/local/etc</code>.) |
|
267 |
</p> |
|
268 |
<p><a name="GDK-Debug-Options"></a><b><code class="envar">GDK_DEBUG</code>. </b> |
|
269 |
If GTK+ has been configured with <code class="option">--enable-debug=yes</code>, |
|
270 |
this variable can be set to a list of debug options, which cause GDK |
|
271 |
to print out different types of debugging information. |
|
272 |
</p> |
|
273 |
<div class="variablelist"><table border="0" class="variablelist"> |
|
274 |
<colgroup> |
|
275 |
<col align="left" valign="top"> |
|
276 |
<col> |
|
277 |
</colgroup> |
|
278 |
<tbody> |
|
279 |
<tr> |
|
280 |
<td><p><span class="term">misc</span></p></td> |
|
281 |
<td><p>Miscellaneous information</p></td> |
|
282 |
</tr> |
|
283 |
<tr> |
|
284 |
<td><p><span class="term">events</span></p></td> |
|
285 |
<td><p>Show all events received by GDK</p></td> |
|
286 |
</tr> |
|
287 |
<tr> |
|
288 |
<td><p><span class="term">dnd</span></p></td> |
|
289 |
<td><p>Information about drag-and-drop</p></td> |
|
290 |
</tr> |
|
291 |
<tr> |
|
292 |
<td><p><span class="term">xim</span></p></td> |
|
293 |
<td><p>Information about XIM support</p></td> |
|
294 |
</tr> |
|
295 |
<tr> |
|
296 |
<td><p><span class="term">nograbs</span></p></td> |
|
297 |
<td><p>Turn off all pointer and keyboard grabs</p></td> |
|
298 |
</tr> |
|
299 |
<tr> |
|
300 |
<td><p><span class="term">multihead</span></p></td> |
|
301 |
<td><p>Information related to multiple screens</p></td> |
|
302 |
</tr> |
|
303 |
<tr> |
|
304 |
<td><p><span class="term">xinerama</span></p></td> |
|
305 |
<td><p>Simulate a multi-monitor setup</p></td> |
|
306 |
</tr> |
|
307 |
<tr> |
|
308 |
<td><p><span class="term">cursor</span></p></td> |
|
309 |
<td><p>Information about cursor objects (only win32)</p></td> |
|
310 |
</tr> |
|
311 |
<tr> |
|
312 |
<td><p><span class="term">draw</span></p></td> |
|
313 |
<td><p>Information about drawing operations (only win32)</p></td> |
|
314 |
</tr> |
|
315 |
<tr> |
|
316 |
<td><p><span class="term">eventloop</span></p></td> |
|
317 |
<td><p>Information about event loop operation (mostly Quartz)</p></td> |
|
318 |
</tr> |
|
319 |
</tbody> |
|
320 |
</table></div> |
|
321 |
<p> |
|
322 |
The special value <code class="literal">all</code> can be used to turn on all |
|
323 |
debug options. |
|
324 |
</p> |
|
325 |
<p><b><code class="envar">GDK_NATIVE_WINDOWS</code>. </b> |
|
326 |
If set, GDK creates all windows as native windows. This can help |
|
327 |
applications that make assumptions about 1-1 correspondence between |
|
328 |
GDK windows and X11 windows. |
|
329 |
</p> |
|
330 |
<p><b><code class="envar">XDG_DATA_HOME</code>, <code class="envar">XDG_DATA_DIRS</code>. </b> |
|
331 |
GTK+ uses these environment variables to locate icon themes |
|
332 |
and MIME information. For more information, see |
|
333 |
<a class="ulink" href="http://freedesktop.org/Standards/icon-theme-spec" target="_top">Icon Theme Specification</a>, |
|
334 |
the <a class="ulink" href="http://freedesktop.org/Standards/shared-mime-info-spec" target="_top">Shared MIME-info Database</a> |
|
335 |
and the <a class="ulink" href="http://freedesktop.org/Standards/basedir-spec" target="_top">Base Directory Specification</a>. |
|
336 |
</p> |
|
337 |
<p><b><code class="envar">DESKTOP_STARTUP_ID</code>. </b> |
|
338 |
GTK+ uses this environment variable to provide startup notification |
|
339 |
according to the <a class="ulink" href="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt" target="_top">Startup Notification Spec</a>. |
|
340 |
Following the specification, GTK+ unsets this variable after reading |
|
341 |
it (to keep it from leaking to child processes). So, if you need its |
|
342 |
value for your own purposes, you have to read it before calling |
|
343 |
gtk_init(). |
|
344 |
</p> |
|
345 |
</div> |
|
346 |
</div> |
|
347 |
</div> |
|
348 |
<div class="footer"> |
|
349 |
<hr> |
|
350 |
Generated by GTK-Doc V1.18</div> |
|
351 |
</body> |
|
352 |
</html> |