$search
00001 #!/usr/bin/env python 00002 00003 import roslib; roslib.load_manifest('rviz_qt') 00004 import sys 00005 from PySide.QtGui import * 00006 from PySide.QtCore import * 00007 import rviz 00008 00009 app = QApplication( sys.argv ) 00010 00011 def acceptIt(): 00012 print 'Accepted!' 00013 app.quit() 00014 00015 def rejectIt(): 00016 print 'Rejected!' 00017 app.quit() 00018 00019 def fun(): 00020 accept = QPushButton( "Accept" ) 00021 accept.clicked.connect( acceptIt ) 00022 00023 reject = QPushButton( "Reject" ) 00024 reject.clicked.connect( rejectIt ) 00025 00026 button_layout = QVBoxLayout() 00027 button_layout.addWidget( accept ) 00028 button_layout.addWidget( reject ) 00029 00030 frame = rviz.VisualizationPanel() 00031 00032 main_layout = QHBoxLayout() 00033 main_layout.addLayout( button_layout ) 00034 main_layout.addWidget( frame ) 00035 00036 main_window = QWidget() 00037 main_window.setLayout( main_layout ) 00038 main_window.show() 00039 00040 app.exec_() 00041 print "the end of fun" 00042 00043 fun() 00044 print "after fun" 00045 00046 sys.exit()