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