WIP, low level python UI functions, so far tested popup menu to work with bpyui.pupMenuBegin, menuItemO and pupMenuEnd functions.

And a popup block with python callback with bpyui.pupBlock, beginBlock, popupBoundsBlock and endBlock funcions.

These functions should not be accessed by scripters directly.
This commit is contained in:
2009-02-16 16:17:20 +00:00
parent 3b6218405b
commit 46417e1362
3 changed files with 300 additions and 0 deletions

View File

@@ -1,4 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <Python.h>
#include "compile.h" /* for the PyCodeObject */
#include "eval.h" /* for PyEval_EvalCode */
@@ -35,6 +38,17 @@ static PyObject *CreateGlobalDictionary( bContext *C )
item = BPY_operator_module(C);
PyDict_SetItemString( dict, "bpyoperator", item );
Py_DECREF(item);
// XXX very experemental, consiter this a test, especiall PyCObject is not meant to be perminant
item = BPY_ui_module();
PyDict_SetItemString( dict, "bpyui", item );
Py_DECREF(item);
// XXX - evil, need to access context
item = PyCObject_FromVoidPtr( C, NULL );
PyDict_SetItemString( dict, "__bpy_context__", item );
Py_DECREF(item);
return dict;
}