How to remove Mayavi toolbar in python using code

独自空忆成欢 提交于 2019-12-01 13:12:23

You can use Handler to modify UI, the following code works with ETS_TOOLKIT=qt4. Add the DisableToolbarHandler class to the code multiple_mlab_scene_models.py, and show the UI by m.edit_traits(handler=DisableToolbarHandler()).

class DisableToolbarHandler(Handler):
    def position(self, info):
        for name in ["scene1", "scene2"]:
            editor = info.ui.get_editors(name)[0]
            editor._scene._tool_bar.setVisible(False)

m = MyDialog()
m.edit_traits(handler=DisableToolbarHandler())

The windows shows as:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!