]> git.saurik.com Git - wxWidgets.git/blame - docs/html/faqgtk.htm
Defaults in wxWinCE documented.
[wxWidgets.git] / docs / html / faqgtk.htm
CommitLineData
ce3ed50d
JS
1<HTML>
2
3<HEAD>
c140b7e7 4<TITLE>wxWidgets 2 for GTK FAQ</TITLE>
ce3ed50d
JS
5</HEAD>
6
4e4dc03d 7<BODY BGCOLOR=#FFFFFF TEXT=#000000 VLINK="#00376A" LINK="#00529C" ALINK="#313063">
ce3ed50d
JS
8
9<font face="Arial, Lucida Sans, Helvetica">
10
4e4dc03d 11<table width=100% border=0 cellpadding=3 cellspacing=0>
ce3ed50d 12<tr>
4e4dc03d
JS
13<td bgcolor="#004080" align=left height=24 background="images/bluetitlegradient.gif">
14<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
c140b7e7 15<b>wxWidgets 2 for GTK FAQ</b>
ce3ed50d
JS
16</font>
17</td>
18</tr>
19</table>
20
21<P>
22
5147354c 23See also <a href="faq.htm">top-level FAQ page</a>
d61c1a6f 24and <a href="faqunx.htm">Unix FAQ page</a>.
ce3ed50d 25<hr>
8b283bb8 26<h3>List of questions in this category</h3>
4f3b37fd
JS
27
28<ul>
c140b7e7
JS
29<li><a href="#wxgtk">What is wxWidgets 2 for GTK+?</a></li>
30<li><a href="#locale">Why doesn&#39;t reading floating point numbers work when using wxWidgets?</a></li>
8b283bb8
JS
31<li><a href="#gnome">Does wxGTK have GNOME support?</a></li>
32<li><a href="#redhat">Warning about GTK libraries supplied with RedHat</a></li>
4f3b37fd 33<li><a href="#bincompat">What range of Intel Linux platforms will a given application binary be usable on?</a></li>
2b5f62a0 34<li><a href="#static">Can I statically link the GTK+ library?</a></li>
b1c1e25b
JS
35<li><a href="#charinframe">Why does my simple program using <tt>EVT_CHAR</tt> not work?</a></li>
36<li><a href="#debugging">How do I trace the cause of an X11 error such as BadMatch?</a></li>
4f3b37fd 37</ul>
53e112a0 38
8b283bb8 39<hr>
ce3ed50d 40
c140b7e7 41<h3><a name="wxgtk">What is wxWidgets 2 for GTK?</a></h3>
4f3b37fd 42
c140b7e7
JS
43wxWidgets 2 for GTK is a port of wxWidgets to the <a href="http://www.gimp.org/gtk" target=_top>GTK+ toolkit</a>,
44which is freely available for most flavours of Unix with X. wxWidgets 2 for GTK is
ce3ed50d
JS
45often abbreviated to wxGTK. wxGTK has a separate home page <a href="http://www.freiburg.linux.de/~wxxt" target=_top>here</a>.
46<P>
47
c140b7e7 48<h3><a name="locale">Why doesn&#39;t reading floating point numbers work when using wxWidgets?</a></h3>
4f3b37fd
JS
49
50If your program reads the floating point numbers in the format <tt>123.45</tt>
966a4a52 51from a file, it may suddenly start returning just <tt>123</tt> instead of the
4f3b37fd
JS
52correct value on some systems -- which is all the more mysterious as the same
53code in a standalone program works just fine.
54
55<p>
56The explanation is that GTK+ changes the current locale on program startup. If
57the decimal point character in the current locale is not the period (for
58example, it is comma in the French locale), all the standard C functions won&#39;t
59recognize the numbers such as above as floating point ones any more.
60
61<p>
62The solution is to either use your own function for reading the floating point
63numbers (probably the best one) or to call <tt>setlocale(LC_NUMERIC, "C")</tt>
64before reading from file and restore the old locale back afterwards if needed.
65
8b283bb8 66<h3><a name="gnome">Does wxGTK have GNOME support?</a></h3>
ce3ed50d
JS
67
68Currently wxGTK does not have any features that would involve dependence on any desktop
8b283bb8 69environment&#39;s libraries, so it can work on GNOME, KDE and with other window managers
ce3ed50d
JS
70without installation hassles. Some GNOME and KDE integration features are file based, and
71so may be added without dependence on libraries. Other features may be supported in the
72future, probably as a separate library.
73<P>
74
2b5f62a0 75<h3><a name="redhat">Warning about GTK+ libraries supplied with RedHat</a></h3>
8b283bb8 76
2b5f62a0 77It seems that some versions of RedHat include a badly patched version of GTK+ (not wxGTK)
c140b7e7 78which causes some trouble with wxWidgets&#39; socket code. Common symptoms are that when
8b283bb8
JS
79a client tries to establish a connection to an existing server which refuses the request,
80the client will get notified twice, first getting a LOST event and then a CONNECT event.
81This problem can be solved by updating GTK with an official distribution of the library.
82<P>
83
53e112a0
JS
84<h3><a name="bincompat">What range of Intel Linux platforms will a given application binary be usable on?</h3>
85
86Robert Roebling replies:<P>
87
5147354c 88&#34;The important thing is the libc version that your app
53e112a0
JS
89is linked against. The most recent version is 2.2.5
90and programs linked against it will not run with version
912.1.X so that you will fare best if you compile your app
92on a 2.1.X system. It will then run on practically all
93Linux distros (if you link you app statically against
5147354c 94the image libraries and std C++ lib).&#34;
2b5f62a0
VZ
95<P>
96
97<h3><a name="#static">Can I statically link the GTK+ library?</a></h3>
98
99No, this is not possible. It leads to crashes in GTK+.
100<P>
101
102<h3><a name="#charinframe">Why does my simple program using
b1c1e25b 103<tt>EVT_CHAR</tt> not work?</a></h3>
2b5f62a0
VZ
104
105In wxGTK, the frames never get focus and so can never receive <tt>CHAR</tt>
106nor <tt>KEY</tt> events so an <tt>EVT_CHAR</tt> handler for a frame will be
107never called. To receive these events, you should create a <tt>wxPanel</tt>
108inside the frame and register the key event handlers for the panel, not the
109frame.
110
111<p>
ce3ed50d 112
b1c1e25b
JS
113<h3><a name="#debugging">How do I trace the cause of an X11 error such as BadMatch?</h3>
114
115When a fatal X11 error occurs, the application quits with no stack trace.
116To find out where the problem is, put a breakpoint on g_log (<tt>b g_log</tt>
117in gdb).
118
119<p>
120
ce3ed50d
JS
121</font>
122
123</BODY>
124
125</HTML>