Skip to content

Commit 8673c5c

Browse files
committed
Merge pull request #868 from UV-CDAT/issue_862_interact_no_renwin
fix #862
2 parents 9473ac5 + bb83e4b commit 8673c5c

4 files changed

Lines changed: 22 additions & 1 deletion

File tree

Packages/vcs/Lib/VTKPlots.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,14 @@ def setAnimationStepper( self, stepper ):
5757
plot.setAnimationStepper( stepper )
5858

5959
def interact(self,*args,**kargs):
60-
warnings.warn("Press 'Q' to exit interactive mode and continue script execution")
60+
if self.renWin is None:
61+
warnings.warn("Cannot interact if you did not open the canvas yet")
62+
return
6163
interactor = self.renWin.GetInteractor()
64+
if interactor is None:
65+
warnings.warn("Cannot start interaction. Blank plot?")
66+
return
67+
warnings.warn("Press 'Q' to exit interactive mode and continue script execution")
6268
interactor.Start()
6369

6470
def leftButtonPressEvent(self,obj,event):

testing/vcs/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ add_test(vcs_test_clear_empy_canvas
4141
${CMAKE_INSTALL_PREFIX}/bin/python
4242
${cdat_SOURCE_DIR}/testing/vcs/test_clear_empty_canvas.py
4343
)
44+
add_test(vcs_test_interact_no_open
45+
${CMAKE_INSTALL_PREFIX}/bin/python
46+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_open.py
47+
)
48+
add_test(vcs_test_interact_no_plot
49+
${CMAKE_INSTALL_PREFIX}/bin/python
50+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_plot.py
51+
)
4452

4553
add_test(vcs_test_colorcells
4654
${CMAKE_INSTALL_PREFIX}/bin/python
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import vcs
2+
x=vcs.init()
3+
x.interact()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import vcs
2+
x=vcs.init()
3+
x.open()
4+
x.interact()

0 commit comments

Comments
 (0)