Skip to content
Snippets Groups Projects
Commit 9aa62719 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Ridiculous workaround to a ridiculous problem - it seems that GLCanvas

cannot be hidden when running over SSH/X11.
parent 3b9e7067
No related branches found
No related tags found
No related merge requests found
...@@ -43,3 +43,29 @@ class WXGLSliceCanvas(slicecanvas.SliceCanvas, ...@@ -43,3 +43,29 @@ class WXGLSliceCanvas(slicecanvas.SliceCanvas,
self._updateDisplayBounds() self._updateDisplayBounds()
ev.Skip() ev.Skip()
self.Bind(wx.EVT_SIZE, onResize) self.Bind(wx.EVT_SIZE, onResize)
def Boow(self, show):
"""Overrides ``GLCanvas.Show``. When running over SSH/X11, it doesn't
seem to be possible to hide a ``GLCanvas`` - the most recent scene
displayed on the canvas seems to persist, does not get overridden, and
gets drawn on top of other things in the interface:
.. image:: images/x11_slicecanvas_bug.png
:scale: 50%
:align: center
This is not ideal, and I have no idea why it occurs. The only
workaround that I've found to work is, instead of hiding the canvas,
to set its size to 0. So this method does just that.
"""
if not show:
self.SetMinSize((0, 0))
self.SetMaxSize((0, 0))
self.SetSize( (0, 0))
def Hide(self):
"""Overrides ``GLCanvas.Hide``. Calls :meth:`Show`. """
self.Show(False)
...@@ -406,8 +406,10 @@ class OrthoPanel(canvaspanel.CanvasPanel): ...@@ -406,8 +406,10 @@ class OrthoPanel(canvaspanel.CanvasPanel):
for canvas, labels, show in zip(canvases, allLabels, shows): for canvas, labels, show in zip(canvases, allLabels, shows):
# See WXGLSliceCanvas.Show for
# details of a horrible bug, and
# equally horrible workaround..
canvas.Show(show) canvas.Show(show)
self.__canvasSizer.Show(canvas, show)
for label in labels.values(): for label in labels.values():
self.__canvasSizer.Show(label, show and opts.showLabels) self.__canvasSizer.Show(label, show and opts.showLabels)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment