enthought / pyface

pyface: traits-capable windowing framework
Other
104 stars 55 forks source link

Toolbars are not created in pyface 8.0 #1251

Open johannesloibl opened 1 year ago

johannesloibl commented 1 year ago

Hey,

there seems to be a copy&pasta error:

https://github.com/enthought/pyface/blob/46f700999284c8104fb2a5468f549677dfadf063/pyface/ui/qt/application_window.py#L159

@observe("tool_bar_managers.items")
def _update_tool_bar_managers(self, event):
    if self.control is not None:
        # Remove the old toolbars.
        for child in self.control.children():
            if isinstance(child, QtGui.QToolBar):
                self.control.removeToolBar(child)
                child.deleteLater()

        # Add the new toolbars.
        if event.new is not None:
            self._create_status_bar(self.control)

The trait change handler for tool bars is creating the status bar instead of the tool bars ;)

jirhiker commented 3 months ago

I can confirm this is an issue.

toolbars were not displaying in my envisage app. Changing the code to

@observe("tool_bar_managers.items")
def _update_tool_bar_managers(self, event):
    if self.control is not None:
        # Remove the old toolbars.
        for child in self.control.children():
            if isinstance(child, QtGui.QToolBar):
                self.control.removeToolBar(child)
                child.deleteLater()

        # Add the new toolbars.
        if event.new is not None:
            #self._create_status_bar(self.control)
             self._create_tool_bar(self.control)

appeared to resolve the issue.

Is there a timeline for when pyface 8.0.X will be released to permanently fix this bug?

Thanks