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

Adapt ui examples to new sip exports

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2090 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent a7e1a62f
Branches
Tags
No related merge requests found
...@@ -51,16 +51,12 @@ class Points(QtGui.QWidget): ...@@ -51,16 +51,12 @@ class Points(QtGui.QWidget):
app=gui.GostyApp.Instance() app=gui.GostyApp.Instance()
pts=Points()
widget = gui.BPQtHandle(sip.unwrapinstance(pts))
app.AddWidgetToApp("points",widget)
#Get main area widget #Get main area widget
main_area=app.perspective.main_area main_area=app.perspective.main_area
pts=Points(main_area.qobject)
#Add Widget #Add Widget
main_area.AddWidget("Some Points", widget) main_area.AddWidget("Some Points", pts)
...@@ -22,23 +22,20 @@ from ost import gui ...@@ -22,23 +22,20 @@ from ost import gui
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from board import Board from board import Board
#Get Panels (Class which manages widgets)
panels=gui.GostyApp.Instance().perspective.panels
#Create Widget #Create Widget
tetris=Board() tetris=Board(panels.qobject)
#Unwrap PyQt Object to C++ Object
unwrapped=gui.BPQtHandle(sip.unwrapinstance(tetris))
#Set Parent of Widget
app=gui.GostyApp.Instance()
app.AddWidgetToApp("Tetris", unwrapped)
#Wrap widget to Qt Widget #Wrap widget to Qt Widget
wid=gui.WrappedWidget(unwrapped) wid=gui.WrappedWidget(tetris)
#Get Panels (Class which manages widgets)
panels=gui.GostyApp.Instance().perspective.panels
#Add Widget to widget pool #Add Widget to widget pool
panels.AddWidgetToPool("Break Widget",wid) panels.AddWidgetToPool("Break Widget",wid)
#Add Widget to right panel #Add Widget to right panel
panels.AddWidget(gui.PanelPosition.RIGHT_PANEL,wid,False) panels.AddWidget(gui.PanelPosition.RIGHT_PANEL,wid,False)
#Fun can start.. #Fun can start..
tetris.start() tetris.start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment