Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/pymodaq_gui/managers/action_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,20 @@ def add_menu(self, short_name: str, title: str, menu: QtWidgets.QMenu = None,

return new_menu

def reference_toolbar(self, short_name: str, toolbar: QtWidgets.QToolBar):
""" Add an existing toolbar to the list of managed toolbars"""
if short_name not in self._toolbars:
self._toolbars[short_name] = toolbar
else:
raise KeyError(f'Toolbar {short_name} is already existing')

def reference_menu(self, short_name: str, menu: QtWidgets.QMenu):
""" Add an existing toolbar to the list of managed toolbars"""
if short_name not in self._menus:
self._menus[short_name] = menu
else:
raise KeyError(f'Menu {short_name} is already existing')

def add_toolbar(self, short_name: str, title: str = '', parent: QtWidgets.QWidget = None) -> QtWidgets.QToolBar:
"""Create and add a toolbar

Expand Down
1 change: 1 addition & 0 deletions src/pymodaq_gui/utils/custom_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self, parent: Union[DockArea, QtWidgets.QMainWindow, QtWidgets.QWid
self.mainwindow.addToolBar(self._toolbar)
self._menubar = self.mainwindow.menuBar()
self.statusbar = self.mainwindow.statusBar()
self.reference_toolbar('main', self._toolbar)


def setup_ui(self):
Expand Down
Loading