Skip to content
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
Closed

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

doutriaux1 opened this issue Jul 7, 2015 · 3 comments
Assignees
Milestone

Comments

@doutriaux1
Copy link
Contributor

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.
@sankhesh
Copy link
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
Copy link
Contributor Author

@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
Copy link
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
Projects
None yet
Development

No branches or pull requests

2 participants