I got it working on Linux for the time being. Here are the gotchas:
- You cannot link against pyFLTK with the static FLTK libraries in it as
pyFLTK is a DSO that gets loaded on demand by python (or in my case, the
embedded python).
PyImport_AppendInittab("fltk", PyInit_fltk); // or however SWIG names its PyObject
Py_Initialize();
PyRun_SimpleString("from fltk import *\n...");
Py_Finalize();
- You have to link everything dynamically and then it works and I can
have my viewer and python creating windows and buttons like there's no
tomorrow even while playing the video.
- The pyFLTK build system is surprisingly good. It found where my
python and FLTK were properly (not the system ones mind you) without
setting any variables. I didn't investigate exactly how it happens.
- The pyFLTK installing however sucks as it installs the python .so in
site-packages/ but with a long prefix directory which makes it
impossible to find or script properly. Need to investigate if the
setup.py script can take some flags.
- The pyFLTK startup code is somewhat broken. It changed all my color
settings on opening a window, going to its default color scheme.
Regarding using multiple languages with swig .i files yes it can be done
with conditionals, but it can get rather messy quickly. You are better
creating .i files for each language.