#include <FXPython.h>
Apart from some minor static information functions and the ability to run embedded pieces of python, the major functionality of this class is solving the "setting python sort functions" problem. Using the static member of this class setSortFunc() you can set an arbitrary python function as the sort function for all of the TnFOX GUI classes using them.
Default implementations are provided for FX::FXListSortFunc, FX::FXFoldingListSortFunc, FX::FXIconListSortFunc, FX::TreeListSortFunc and FX::FXZSortFunc. You can set a maximum of 8 process-wide python sorting functions for each (adjustable by a compile-time constant).
Static Public Member Functions | |
static FXString | interpreterPath () |
static FXString | version () |
static FXString | platform () |
static FXString | programName () |
static void | setProgramName (const FXString &name) |
static void | setArgv (int argc, char **argv) |
static boost::python::handle | globals () |
static boost::python::handle | execute (const FXString &code, boost::python::handle<> context=globals()) |
static boost::python::handle | evaluate (const FXString &code, boost::python::handle<> context=globals()) |
static void | setFXComboBoxSortFunc (FXComboBox &list, boost::python::api::object *code) |
static void | setFXFoldingListSortFunc (FXFoldingList &list, boost::python::api::object *code) |
static void | setFXGLViewerSortFunc (FXGLViewer &list, boost::python::api::object *code) |
static void | setFXIconListSortFunc (FXIconList &list, boost::python::api::object *code) |
static void | setFXListSortFunc (FXList &list, boost::python::api::object *code) |
static void | setFXListBoxSortFunc (FXListBox &list, boost::python::api::object *code) |
static void | setFXTreeListSortFunc (FXTreeList &list, boost::python::api::object *code) |
static void | setFXTreeListBoxSortFunc (FXTreeListBox &list, boost::python::api::object *code) |
static void | int_throwPythonException () |
static void | int_initEmbeddedEnv () |
static void | int_runPythonThread (PyObject *self, QThread *cthread) |
static void | int_pythonObjectCreated (Generic::BoundFunctorV *detach) |
static void | int_pythonObjectDeleted (Generic::BoundFunctorV *detach) |
static bool | int_FXObjectHandle (long *ret, FXObject *self, FXObject *sender, FXSelector sel, void *ptr) |
static FXString FX::FXPython::interpreterPath | ( | ) | [static] |
Returns the absolute path of the python interpreter.
static FXString FX::FXPython::version | ( | ) | [static] |
Returns the version of the interpreter (same as sys.version
).
static FXString FX::FXPython::platform | ( | ) | [static] |
Returns the current platform according to python (same as sys.platform
).
static FXString FX::FXPython::programName | ( | ) | [static] |
Returns the name of the program as python thinks it is.
static void FX::FXPython::setProgramName | ( | const FXString & | name | ) | [static] |
Sets the name of the program as python thinks it is. Normally done for you if you created python.
static void FX::FXPython::setArgv | ( | int | argc, | |
char ** | argv | |||
) | [static] |
Sets the process arguments for python. Normally done for you if you created python. Normally, you'll want argv[0] to be a null string - see the docs for PySys_SetArgv()
.
static boost::python::handle FX::FXPython::globals | ( | ) | [static] |
Returns a handle to the dictionary globals()
within __main__
.
static boost::python::handle FX::FXPython::execute | ( | const FXString & | code, | |
boost::python::handle<> | context = globals() | |||
) | [static] |
Executes the specified piece of code within the specified context (ie; globals()) which can contain multiple lines (separate with \n), returning whatever the code returns. Ensure that an interpreter context has been set beforehand using FX::FXPythonInterp::setContext()
static boost::python::handle FX::FXPython::evaluate | ( | const FXString & | code, | |
boost::python::handle<> | context = globals() | |||
) | [static] |
Evaluates the specified python expression, returning the result. Ensure that an interpreter context has been set beforehand using FX::FXPythonInterp::setContext()
static void FX::FXPython::setFXComboBoxSortFunc | ( | FXComboBox & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXFoldingListSortFunc | ( | FXFoldingList & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXGLViewerSortFunc | ( | FXGLViewer & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXIconListSortFunc | ( | FXIconList & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXListSortFunc | ( | FXList & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXListBoxSortFunc | ( | FXListBox & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXTreeListSortFunc | ( | FXTreeList & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.
static void FX::FXPython::setFXTreeListBoxSortFunc | ( | FXTreeListBox & | list, | |
boost::python::api::object * | code | |||
) | [static] |
Sets a C++ callable sorting function for python function code.