pyface icon indicating copy to clipboard operation
pyface copied to clipboard

Toolbars are not created in pyface 8.0

Open johannesloibl opened this issue 2 years ago • 1 comments

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 ;)

johannesloibl avatar Jun 12 '23 13:06 johannesloibl

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

jirhiker avatar Apr 09 '24 21:04 jirhiker