New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't switch to portrait mode while in background mode #1446

Closed
doutriaux1 opened this Issue Jul 7, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@doutriaux1
Member

doutriaux1 commented Jul 7, 2015

import numpy
data=numpy.sin(numpy.arange(100))
data=numpy.reshape(data,(10,10))
import vcs
x=vcs.init()
x.plot(data,bg=1)
x.clear()
x.portrait()

leads to:

python: /home/doutriaux1/build/build/VTK/Rendering/OpenGL/vtkOpenGLRenderWindow.cxx:1603: int vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow(int, int): Assertion `"pre: positive_width" && width>0' failed.

@doutriaux1 doutriaux1 added this to the 2.3 milestone Jul 7, 2015

@sankhesh

This comment has been minimized.

Contributor

sankhesh commented Jul 9, 2015

@doutriaux1 The issue comes from Canvas.py::portrait(); whereby it calls self.canvas.canvasinfo. However, canvasinfo is not a member of the class Canvas defined here.

Is it just the indentation that is wrong when defining function canvasinfo ?

OR

Should I change all references of self.canvas.canvasinfo to self.canvasinfo?

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Jul 9, 2015

@sankhesh it seems to be part of it.

In [5]: import vcs

In [6]: x=vcs.init()

In [7]: x.canvasinfo()
Out[7]: {'depth': None, 'height': 606, 'mapstate': False, 'width': 814, 'x': 0, 'y': 0}

I'm not sure I understand your question.

@sankhesh

This comment has been minimized.

Contributor

sankhesh commented Jul 9, 2015

@doutriaux1 Sorry I framed the question wrong.

What I meant was that canvasinfo is a member of class Canvas and hence should be used like: dict = apply(self.canvasinfo, cargs) instead of like dict = apply(self.canvas.canvasinfo, cargs) in Canvas.py::portrait()

self.canvas returns vcs object as set here

So my question is whether canvasinfo was intended to be a member of vcs?

If yes, I will have to change its indentation in the Canvas.py file.

If no, I will have to change all references of self.canvas.canvasinfo() to self.canvasinfo().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment