From 58f0e7bc42f7724934d939a79f381da3383fd01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=8D=8E=E9=9D=92=28Huaqing=2EH=29?= Date: Wed, 15 Mar 2023 20:56:37 +0800 Subject: [PATCH] fixing a documentation example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following errors in the sample code: AttributeError: 'renderdoc.ActionDescription' object has no attribute 'name' NameError: name 'window_callback' is not defined --- docs/python_api/ui_extensions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/python_api/ui_extensions.rst b/docs/python_api/ui_extensions.rst index 7edb92603..63557dc36 100644 --- a/docs/python_api/ui_extensions.rst +++ b/docs/python_api/ui_extensions.rst @@ -115,11 +115,11 @@ And finally we can fill in the event functions to set the breadcrumbs. We use `` breadcrumbs = '' if action is not None: - breadcrumbs = '@{}: {}'.format(action.eventId, action.name) + breadcrumbs = '@{}: {}'.format(action.eventId, action.customName) while action.parent is not None: action = action.parent - breadcrumbs = '@{}: {}'.format(action.eventId, action.name) + '\n' + breadcrumbs + breadcrumbs = '@{}: {}'.format(action.eventId, action.customName) + '\n' + breadcrumbs self.mqt.SetWidgetText(self.breadcrumbs, "Breadcrumbs:\n{}".format(breadcrumbs)) @@ -159,7 +159,7 @@ Finally we'll register a new menu item to display the window. We only allow one def register(version: str, ctx: qrd.CaptureContext): # as above ... - ctx.Extensions().RegisterWindowMenu(qrd.WindowMenu.Window, ["Extension Window"], window_callback) + ctx.Extensions().RegisterWindowMenu(qrd.WindowMenu.Window, ["Extension Window"], open_window_callback) def unregister():