Skip to content
Snippets Groups Projects
Commit eb4a9b4a authored by stefan's avatar stefan
Browse files

New sip export for Perspective

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2079 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent ec295f74
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,8 @@ using namespace boost::python;
#include <ost/gui/tools/tool_options_win.hh>
#include "transfer_ownership.hh"
#include "sip_handler.hh"
#include "python_shell_proxy.hh"
#include "tool_options_win_proxy.hh"
#include "scene_win_proxy.hh"
......@@ -84,6 +86,13 @@ void app_add_widget_to_app_a(GostyApp* app, const QString& ident,
}
}
void app_add_widget_to_app_b(GostyApp* app, const QString& ident,
object py_object)
{
if(QWidget* widget = get_cpp_qobject<QWidget>(py_object)){
app->AddWidgetToApp(ident, widget);
}
}
void export_Gosty()
{
......@@ -112,6 +121,7 @@ void export_Gosty()
make_function(&GostyApp::GetPerspective,
return_value_policy<reference_existing_object>()))
.def("AddWidgetToApp", &app_add_widget_to_app_a)
.def("AddWidgetToApp", &app_add_widget_to_app_b)
.def("GetPerspective", &GostyApp::GetPerspective,
return_value_policy<reference_existing_object>())
;
......
......@@ -57,6 +57,7 @@ void export_Perspective()
return_value_policy<reference_existing_object>()))
.add_property("panels", make_function(&Perspective::GetPanels,
return_value_policy<reference_existing_object>()))
.add_property("menubar", make_function(&app_get_menu_bar))
;
}
......@@ -18,6 +18,7 @@
#------------------------------------------------------------------------------
import sip
from ost import gui
from ost import gfx
from PyQt4 import QtCore, QtGui
......@@ -45,8 +46,7 @@ def _InitInspector():
mywidget = InspectorDialog(app.gl_win.qobject)
mywidget.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.Tool)
mywidget.show()
unwrapped = gui.BPQtHandle(sip.unwrapinstance(mywidget))
app.AddWidgetToApp("InspectorDialog", unwrapped)
app.AddWidgetToApp("InspectorDialog", mywidget)
menu_bar=app.perspective.GetMenuBar()
InitInspectorMenu(mywidget,menu_bar)
import __main__
import sip
import sys
import optparse
from ost import io, mol, seq, geom, conop, gui
......@@ -50,7 +49,7 @@ def _InitFrontEnd():
app.SetAppTitle("DNG")
main_area=app.perspective.main_area
_InitPanels(app, app.perspective.panels)
_InitMenuBar(app.perspective.GetMenuBar())
_InitMenuBar(app.perspective.menubar)
_InitSpaceNav(app.perspective.panels.qobject)
_InitContextMenu()
main_area.AddPersistentWidget("3D Scene", "gl_win" , app.gl_win.qobject, int(QtCore.Qt.WindowMaximized))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment