Hi,
I'm new with RV Python, and just have been experimenting with adding and removing UI from the main window.
I want to do something like the "Session Manager" where you have a hot key, "x", to display and remove. I got that much to work except when the widget is floating.
Here's my "Hello RV" code:
from PyQt4 import QtGui, QtCore
from rv import rvtypes
class HelloRV(rvtypes.MinorMode):
def __init__(self):
rvtypes.MinorMode.__init__(self)
self.init("HelloRV", None, [("key-down--X", self.toggleWidget, "X Key")])
top_level_widgets = QtGui.QApplication.topLevelWidgets()
self.main_window = None
for widget in top_level_widgets:
if isinstance(widget, QtGui.QMainWindow):
self.main_window = widget
self.my_dock_widget = QtGui.QDockWidget()
label = QtGui.QLabel("This is the only thing inside the dock widget")
self.my_dock_widget.setWidget(label)
self.main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, self.my_dock_widget)
self.my_dock_widget.close()
def toggleWidget(self, event):
if self.my_dock_widget.isHidden():
self.my_dock_widget.show()
else:
self.my_dock_widget.close()
def createMode():
return HelloRV()
It works just fine when the widget is docked, but when it's floating, it gives me this error:
ERROR: event = menu
ERROR: function = __lambda859 (void; Event ignored)
ERROR: Exception Value: exception: "invalid property name #RVTransform2D.transform.flop"
Can somebody tell me what I'm doing wrong? Thanks!