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

EzTemplate object has no close function #1585

Closed
durack1 opened this issue Oct 5, 2015 · 10 comments
Closed

EzTemplate object has no close function #1585

durack1 opened this issue Oct 5, 2015 · 10 comments
Assignees
Milestone

Comments

@durack1
Copy link
Member

durack1 commented Oct 5, 2015

The EzTemplate object has no close or exit functions, so I am uncertain how to purge or manipulate an EzTemplate object during an interactive session once it is created (and previewed):

>>> Canvas = EzTemplate.Multi(rows=2,columns=2)
>>> Canvas.preview('Template4x4',bg=bg)
>>> dir(Canvas)
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '_columns', '_getcolumns', '_getrows', '_gettemplate', '_rows', '_setcolumns', '_setrows', '_settemplate', '_template', 'clean', 'columns', 'get', 'id', 'legend', 'list', 'margins', 'preview', 'rows', 'spacing', 'template', 'template_names', 'x']
>>> Canvas.clean()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/uvcdat/2.4.0rc1/lib/python2.7/site-packages/vcsaddons/Multi.py", line 229, in clean
    self.x.removeP(t)
  File "/usr/local/uvcdat/2.4.0rc1/lib/python2.7/site-packages/vcs/Canvas.py", line 1275, in removeP
    return self.canvas.removeP(*args)
AttributeError: 'module' object has no attribute 'removeP'

During the session above, a VCS canvas window appears, however I am unable to close this using the X (top right corner) or using a Canvas.close() (or equivalent, that I can find) on the commandline.

@durack1 durack1 added the VCS label Oct 5, 2015
@doutriaux1
Copy link
Contributor

it shouldn't. When you do a get you get a template that you can remove. Will fix the clean issue.
By the way you do NOT get a canvas back. it's an EZTemplate object, not a vas canvas.

@doutriaux1 doutriaux1 self-assigned this Oct 5, 2015
@doutriaux1 doutriaux1 added this to the 2.4 milestone Oct 5, 2015
@durack1
Copy link
Member Author

durack1 commented Oct 5, 2015

@doutriaux1 ok, so I have a persistent Canvas/EzTemplate object that I cannot close.. So how do I go about closing it using a get?

The inability to close this window using the X in the top right hand corner is a nasty bug.. The only way that I can kill this persistent window is to terminate my active python session, which is not reasonable for what should be a very simple (and intuitive) operation.

@doutriaux1
Copy link
Contributor

you mean after a preview?

@durack1
Copy link
Member Author

durack1 commented Oct 5, 2015

@doutriaux1 exactly..

@doutriaux1
Copy link
Contributor

yes after the preview it is a canvas, you can access it as Canvas.x.close() in your case. You're right Canvas.preview() should probably return an handle to the canvas.

@doutriaux1
Copy link
Contributor

will put this in the bug fix. Will become something like that:

Multi = EzTemplate.Multi(rows=2,columns=2)
Canvas = Multi.preview('Template4x4',bg=bg)
Canvas.close()

@durack1
Copy link
Member Author

durack1 commented Oct 5, 2015

@doutriaux1 ok so Canvas.x.close() works (the window terminates), but I had no idea that I needed to call the x to initiate a close.. The above looks much more reasonable to me..

@durack1
Copy link
Member Author

durack1 commented Oct 5, 2015

@doutriaux1 also, the inability to close it using the window/canvas controls (top right hand X) is also a concern to me.. These window controls should always work..

@durack1
Copy link
Member Author

durack1 commented Oct 8, 2015

@doutriaux1 fixed #1591?

@doutriaux1
Copy link
Contributor

yes

doutriaux1 added a commit that referenced this issue Oct 9, 2015
doutriaux1 added a commit that referenced this issue Oct 11, 2015
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

3 participants