]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/x11.sgml
Remove long-obsolete docs
[~andy/gtk] / docs / reference / gtk / x11.sgml
1 <?xml version="1.0"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3                "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 ]>
5 <refentry id="gtk-x11" revision="17 Jan 2002">
6 <refmeta>
7 <refentrytitle>Using GTK+ on the X Window System</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>GTK Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>Using GTK+ on the X Window System</refname>
14 <refpurpose>
15 X11 aspects of using GTK+
16 </refpurpose>
17 </refnamediv>
18
19 <refsect1>
20 <title>GTK+ for the X Window System</title>
21
22 <para>
23 On UNIX, the X backend is the default build for GTK+. So 
24 you don't need to do anything special when compiling it,
25 and everything should "just work."
26 </para>
27
28 <para>
29 To mix low-level Xlib routines into a GTK program, 
30 see <link linkend="gdk-X-Window-System-Interaction">GDK X Window
31 System interaction</link> in the GDK manual.
32 </para>
33
34 <refsect2 id="x11-cmdline">
35 <title>X11-specific commandline options</title>
36
37 <para>
38 The X backend understands some additional command line 
39 arguments.
40 </para>
41
42 <formalpara>
43 <title><systemitem>--display <replaceable>display</replaceable></systemitem></title>
44
45 <para>
46 The name of the X display to open instead of the one specified
47 in the <envar>DISPLAY</envar> environment variable. 
48 </para>
49 </formalpara>
50
51 <formalpara>
52 <title><systemitem>--screen <replaceable>screen_number</replaceable></systemitem></title>
53
54 <para>
55   The number of the screen within the default display. This overrides
56   any screen number specified in the display name specified by
57   by he <systemitem>--display</systemitem> command line option or
58   the <envar>DISPLAY</envar> environment variable. If this screen
59   cannot be opened, then GTK+ will fall back to the screen
60   specified in the display name. This option is not useful
61   interactively; the intended purposes is that when a program
62   registers its command line with a <firstterm>session
63   manager</firstterm> for later restarting, it can save the
64   screen it is on, without having to worry if it might be
65   restarted on a different display.
66 </para>
67 </formalpara>
68
69 <formalpara>
70 <title><systemitem>--sync</systemitem></title>
71
72 <para>
73 Makes all X requests synchronously. This is a useful option for 
74 debugging, but it will slow down the performance considerably.
75 </para>
76 </formalpara>
77
78 </refsect2>
79
80 </refsect1>
81
82 <refsect1 id="gtk-X11-arch">
83 <title>Understanding the X11 architecture</title>
84
85 <para>
86 People coming from a Windows or MacOS background often find certain
87 aspects of the X Window System surprising. This section introduces
88 some basic X concepts at a high level. For more details, the book most
89 people use is called the <citetitle pubwork="book">Xlib Programming
90 Manual</citetitle> by Adrian Nye; this book is volume one in the
91 O'Reilly X Window System series.
92 </para>
93 <para>
94 Standards are another important resource if you're poking in low-level
95 X11 details, in particular the ICCCM and the Extended Window Manager
96 Hints specifications. <ulink
97 url="http://www.freedesktop.org/standards/">freedesktop.org</ulink>
98 has links to many relevant specifications.
99 </para>
100 <para>
101 The GDK manual covers <link
102 linkend="gdk-X-Window-System-Interaction">using Xlib in a GTK
103 program</link>.
104 </para>
105
106 <refsect2>
107 <title>Server, client, window manager</title>
108
109 <para>
110 Other window systems typically put all their functionality in the
111 application itself. With X, each application involves three different
112 programs: the <firstterm>X server</firstterm>, the application (called
113 a <firstterm>client</firstterm> because it's a client of the X
114 server), and a special client called the <firstterm>window
115 manager</firstterm>.
116 </para>
117
118 <para>
119 The X server is in charge of managing resources, processing drawing
120 requests, and dispatching events such as keyboard and mouse events to
121 interested applications. So client applications can ask the X server
122 to create a window, draw a circle, or move windows around.
123 </para>
124
125 <para>
126 The window manager is in charge of rendering the frame or borders
127 around windows; it also has final say on the size of each window,
128 and window states such as minimized, maximized, and so forth.
129 On Windows and MacOS the application handles most of this.
130 On X11, if you wish to modify the window's state, or 
131 change its frame, you must ask the window manager to do so on your
132 behalf, using an established  <ulink
133 url="http://www.freedesktop.org/standards/">convention</ulink>.
134 </para>
135
136 <para>
137 GTK+ has functions for asking the window manager to do various things;
138 see for example <link
139 linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link
140 linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link
141 linkend="gtk-window-set-decorated">gtk_window_set_decorated()</link>.
142 Keep in mind that <link
143 linkend="gtk-window-move">gtk_window_move()</link> and window sizing
144 are ultimately controlled by the window manager as well and most
145 window managers <emphasis>will</emphasis> ignore certain requests from
146 time to time, in the interests of good user interface.
147 </para>
148
149 <!--
150 May also want to explain DESKTOP_STARTUP_ID here. 
151 http://www.freedesktop.org/Standards/startup-notification-spec
152 -->
153
154 </refsect2>
155
156 </refsect1>
157
158 </refentry>