def METHOD_NAME(self, menu, x, y):
    # Add any tool-specific items to the given context menu (a QMenu instance).
    # The menu will then be automatically filled out with generic tool-related actions
    # (e.g. Hide Tool, Help, Dockable Tool, etc.)
    #
    # The x,y args are the x() and y() values of QContextMenuEvent, in the rare case
    # where the items put in the menu depends on where in the tool interface the menu
    # was raised.
    from PyQt5.QtWidgets import QAction
    settings_action = QAction("HKLviewer settings", menu)
    settings_action.triggered.connect(lambda *args: self.Guiobj.SettingsDialog() )
    menu.addAction(settings_action)