Re: Creating an app with optional GTK support



On 05/14/10 06:26, Andreas Falkenhahn wrote:
Hi,

I'm currently developing an X11 app and would like to use GTK only for the
file chooser dialog. The rest is done entirely in X11. However, the GTK
support shall be optional. If GTK is there, then my app will use the GTK
file chooser. If GTK is not there, I'll simply ask for a file name using a
fgets() on stdin :-)

Now to my question: Because I want my app to run even if GTK is not
present, I can't link against the GTK libs. Instead, I have to use
dlopen() and manually read the function pointers of the functions I need
using dlsym(). This all works fine so far, except one thing: There are
name discrepancies across the different distros. For example, comparing
openSUSE and Ubuntu:

Might be simpler to write a stand-alone file chooser app in GTK+ and, if needed, talk fork()/exec() it and talk to it through pipes or sockets. (I have a GTK+ wrapper for a closed-source implementation of APL that does this. It works fine.)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]