2004-02-25 05:45:02 -05:00
|
|
|
|
1999-01-19 06:00:22 -05:00
|
|
|
<HTML>
|
|
|
|
|
|
|
|
<HEAD>
|
2004-02-25 05:45:02 -05:00
|
|
|
<TITLE>wxWidgets 2 for GTK FAQ</TITLE>
|
1999-01-19 06:00:22 -05:00
|
|
|
</HEAD>
|
|
|
|
|
2002-04-08 16:17:40 -04:00
|
|
|
<BODY BGCOLOR=#FFFFFF TEXT=#000000 VLINK="#00376A" LINK="#00529C" ALINK="#313063">
|
1999-01-19 06:00:22 -05:00
|
|
|
|
|
|
|
<font face="Arial, Lucida Sans, Helvetica">
|
|
|
|
|
2002-04-08 16:17:40 -04:00
|
|
|
<table width=100% border=0 cellpadding=3 cellspacing=0>
|
1999-01-19 06:00:22 -05:00
|
|
|
<tr>
|
2002-04-08 16:17:40 -04:00
|
|
|
<td bgcolor="#004080" align=left height=24 background="images/bluetitlegradient.gif">
|
|
|
|
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
|
2004-02-25 05:45:02 -05:00
|
|
|
<b>wxWidgets 2 for GTK FAQ</b>
|
1999-01-19 06:00:22 -05:00
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<P>
|
|
|
|
|
2004-02-25 05:45:02 -05:00
|
|
|
See also <a href="faq.htm">top-level FAQ page</a>
|
2004-02-17 05:06:26 -05:00
|
|
|
and <a href="faqunx.htm">Unix FAQ page</a>.
|
1999-01-19 06:00:22 -05:00
|
|
|
<hr>
|
2001-11-20 09:55:10 -05:00
|
|
|
<h3>List of questions in this category</h3>
|
2002-08-16 05:55:54 -04:00
|
|
|
|
|
|
|
<ul>
|
2004-02-25 05:45:02 -05:00
|
|
|
<li><a href="#wxgtk">What is wxWidgets 2 for GTK+?</a></li>
|
|
|
|
<li><a href="#locale">Why doesn't reading floating point numbers work when using wxWidgets?</a></li>
|
2001-11-20 09:55:10 -05:00
|
|
|
<li><a href="#gnome">Does wxGTK have GNOME support?</a></li>
|
|
|
|
<li><a href="#redhat">Warning about GTK libraries supplied with RedHat</a></li>
|
2002-08-16 05:55:54 -04:00
|
|
|
<li><a href="#bincompat">What range of Intel Linux platforms will a given application binary be usable on?</a></li>
|
2002-12-04 09:11:26 -05:00
|
|
|
<li><a href="#static">Can I statically link the GTK+ library?</a></li>
|
2003-08-25 21:32:14 -04:00
|
|
|
<li><a href="#charinframe">Why does my simple program using <tt>EVT_CHAR</tt> not work?</a></li>
|
|
|
|
<li><a href="#debugging">How do I trace the cause of an X11 error such as BadMatch?</a></li>
|
2002-08-16 05:55:54 -04:00
|
|
|
</ul>
|
2002-06-05 17:06:18 -04:00
|
|
|
|
2001-11-20 09:55:10 -05:00
|
|
|
<hr>
|
1999-01-19 06:00:22 -05:00
|
|
|
|
2004-02-25 05:45:02 -05:00
|
|
|
<h3><a name="wxgtk">What is wxWidgets 2 for GTK?</a></h3>
|
2002-08-16 05:55:54 -04:00
|
|
|
|
2004-02-25 05:45:02 -05:00
|
|
|
wxWidgets 2 for GTK is a port of wxWidgets to the <a href="http://www.gimp.org/gtk" target=_top>GTK+ toolkit</a>,
|
|
|
|
which is freely available for most flavours of Unix with X. wxWidgets 2 for GTK is
|
1999-01-19 06:00:22 -05:00
|
|
|
often abbreviated to wxGTK. wxGTK has a separate home page <a href="http://www.freiburg.linux.de/~wxxt" target=_top>here</a>.
|
|
|
|
<P>
|
|
|
|
|
2004-02-25 05:45:02 -05:00
|
|
|
<h3><a name="locale">Why doesn't reading floating point numbers work when using wxWidgets?</a></h3>
|
2002-08-16 05:55:54 -04:00
|
|
|
|
|
|
|
If your program reads the floating point numbers in the format <tt>123.45</tt>
|
|
|
|
from a file, it may suddently start returning just <tt>123</tt> instead of the
|
|
|
|
correct value on some systems -- which is all the more mysterious as the same
|
|
|
|
code in a standalone program works just fine.
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The explanation is that GTK+ changes the current locale on program startup. If
|
|
|
|
the decimal point character in the current locale is not the period (for
|
|
|
|
example, it is comma in the French locale), all the standard C functions won't
|
|
|
|
recognize the numbers such as above as floating point ones any more.
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The solution is to either use your own function for reading the floating point
|
|
|
|
numbers (probably the best one) or to call <tt>setlocale(LC_NUMERIC, "C")</tt>
|
|
|
|
before reading from file and restore the old locale back afterwards if needed.
|
|
|
|
|
2001-11-20 09:55:10 -05:00
|
|
|
<h3><a name="gnome">Does wxGTK have GNOME support?</a></h3>
|
1999-01-19 06:00:22 -05:00
|
|
|
|
|
|
|
Currently wxGTK does not have any features that would involve dependence on any desktop
|
2001-11-20 09:55:10 -05:00
|
|
|
environment's libraries, so it can work on GNOME, KDE and with other window managers
|
1999-01-19 06:00:22 -05:00
|
|
|
without installation hassles. Some GNOME and KDE integration features are file based, and
|
|
|
|
so may be added without dependence on libraries. Other features may be supported in the
|
|
|
|
future, probably as a separate library.
|
|
|
|
<P>
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
<h3><a name="redhat">Warning about GTK+ libraries supplied with RedHat</a></h3>
|
2001-11-20 09:55:10 -05:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
It seems that some versions of RedHat include a badly patched version of GTK+ (not wxGTK)
|
2004-02-25 05:45:02 -05:00
|
|
|
which causes some trouble with wxWidgets' socket code. Common symptoms are that when
|
2001-11-20 09:55:10 -05:00
|
|
|
a client tries to establish a connection to an existing server which refuses the request,
|
|
|
|
the client will get notified twice, first getting a LOST event and then a CONNECT event.
|
|
|
|
This problem can be solved by updating GTK with an official distribution of the library.
|
|
|
|
<P>
|
|
|
|
|
2002-06-05 17:06:18 -04:00
|
|
|
<h3><a name="bincompat">What range of Intel Linux platforms will a given application binary be usable on?</h3>
|
|
|
|
|
|
|
|
Robert Roebling replies:<P>
|
|
|
|
|
|
|
|
"The important thing is the libc version that your app
|
|
|
|
is linked against. The most recent version is 2.2.5
|
|
|
|
and programs linked against it will not run with version
|
|
|
|
2.1.X so that you will fare best if you compile your app
|
|
|
|
on a 2.1.X system. It will then run on practically all
|
|
|
|
Linux distros (if you link you app statically against
|
|
|
|
the image libraries and std C++ lib)."
|
2002-12-04 09:11:26 -05:00
|
|
|
<P>
|
|
|
|
|
|
|
|
<h3><a name="#static">Can I statically link the GTK+ library?</a></h3>
|
|
|
|
|
|
|
|
No, this is not possible. It leads to crashes in GTK+.
|
|
|
|
<P>
|
|
|
|
|
|
|
|
<h3><a name="#charinframe">Why does my simple program using
|
2003-08-25 21:32:14 -04:00
|
|
|
<tt>EVT_CHAR</tt> not work?</a></h3>
|
2002-12-04 09:11:26 -05:00
|
|
|
|
|
|
|
In wxGTK, the frames never get focus and so can never receive <tt>CHAR</tt>
|
|
|
|
nor <tt>KEY</tt> events so an <tt>EVT_CHAR</tt> handler for a frame will be
|
|
|
|
never called. To receive these events, you should create a <tt>wxPanel</tt>
|
|
|
|
inside the frame and register the key event handlers for the panel, not the
|
|
|
|
frame.
|
|
|
|
|
|
|
|
<p>
|
1999-01-19 06:00:22 -05:00
|
|
|
|
2003-08-25 21:32:14 -04:00
|
|
|
<h3><a name="#debugging">How do I trace the cause of an X11 error such as BadMatch?</h3>
|
|
|
|
|
|
|
|
When a fatal X11 error occurs, the application quits with no stack trace.
|
|
|
|
To find out where the problem is, put a breakpoint on g_log (<tt>b g_log</tt>
|
|
|
|
in gdb).
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
1999-01-19 06:00:22 -05:00
|
|
|
</font>
|
|
|
|
|
|
|
|
</BODY>
|
|
|
|
|
|
|
|
</HTML>
|