Skip to content

Commit 11fc99f

Browse files
committed
fix #862
1 parent e3032f8 commit 11fc99f

2 files changed

Lines changed: 15 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
@@ -33,6 +33,14 @@ add_test(vcs_test_clear_empy_canvas
3333
${CMAKE_INSTALL_PREFIX}/bin/python
3434
${cdat_SOURCE_DIR}/testing/vcs/test_clear_empty_canvas.py
3535
)
36+
add_test(vcs_test_interact_no_open
37+
${CMAKE_INSTALL_PREFIX}/bin/python
38+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_open.py
39+
)
40+
add_test(vcs_test_interact_no_plot
41+
${CMAKE_INSTALL_PREFIX}/bin/python
42+
${cdat_SOURCE_DIR}/testing/vcs/test_vcs_interact_no_plot.py
43+
)
3644

3745
add_test(vcs_test_colorcells
3846
${CMAKE_INSTALL_PREFIX}/bin/python

0 commit comments

Comments
 (0)