enthought / enthought/mayavi

pyqt5, tvtk SceneModel pane not moving in some traitsui views

Open
#855 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

In two cases, firstly when using an (traitsui) InstanceEditor on a class inheriting from SceneModel. See minimal example:

```
from tvtk.pyface.scene_model import SceneModel
from tvtk.pyface.scene_editor import SceneEditor
from tvtk.api import tvtk

from traits.api import Button, HasStrictTraits, Instance, Int, Property

from traitsui.api import UItem, View, InstanceEditor

# %%


class InheritedScene(SceneModel):

#: someone tell me how put self as an UItem
self_scene = Property()

def _get_self_scene(self):
return self

test_view = View(
UItem('self_scene', editor=SceneEditor())
)


class TestSceneViewer(HasStrictTraits):

test_scene = Instance(InheritedScene, ())

view = View(
UItem('test_scene', style='custom',
editor=InstanceEditor(view='test_view')),
resizable=True
)


test_scene_viewer = TestSceneViewer()
test_scene_viewer.test_scene.configure_traits(view='test_view') # fine
test_scene_viewer.configure_traits(view='view') # broken
```

And the second (more important case) is the toolbar is not moving when I drag the window around when I embed it within a VSplit/HSplit (it works fine with Groups tho). See the minimal example below:

```
from traits.api import Button, HasStrictTraits, Instance

from traitsui.api import UItem, VSplit, View

from tvtk.pyface.scene_editor import SceneEditor
from tvtk.pyface.scene_model import SceneModel


class TestSceneViewer(HasStrictTraits):

test_scene = Instance(SceneModel, ())

create_arrow = Button()

view = View(
VSplit(
UItem('test_scene', editor=SceneEditor()),
UItem('create_arrow'),
),
resizable=True
)


this_scene = SceneModel()
test_scene_viewer = TestSceneViewer(test_scene=this_scene)
test_scene_viewer.configure_traits()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.