本文整理汇总了Python中volumina.utility.ShortcutManager.update_description方法的典型用法代码示例。如果您正苦于以下问题:Python ShortcutManager.update_description方法的具体用法?Python ShortcutManager.update_description怎么用?Python ShortcutManager.update_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volumina.utility.ShortcutManager
的用法示例。
在下文中一共展示了ShortcutManager.update_description方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _updateLabelShortcuts
# 需要导入模块: from volumina.utility import ShortcutManager [as 别名]
# 或者: from volumina.utility.ShortcutManager import update_description [as 别名]
def _updateLabelShortcuts(self):
numShortcuts = len(self._labelShortcuts)
numRows = len(self._labelControlUi.labelListModel)
mgr = ShortcutManager()
ActionInfo = ShortcutManager.ActionInfo
# Add any shortcuts we don't have yet.
for i in range(numShortcuts, numRows):
toolTipObject = LabelListModel.EntryToolTipAdapter(
self._labelControlUi.labelListModel, i)
action_info = ActionInfo(
"Labeling", "Select Label {}".format(i + 1),
"Select Label {}".format(i + 1),
partial(self._labelControlUi.labelListView.selectRow,
i), self._labelControlUi.labelListView, toolTipObject)
mgr.register(str(i + 1), action_info)
self._labelShortcuts.append(action_info)
# Make sure that all shortcuts have an appropriate description
for i in range(numRows):
action_info = self._labelShortcuts[i]
description = "Select " + self._labelControlUi.labelListModel[
i].name
new_action_info = mgr.update_description(action_info, description)
self._labelShortcuts[i] = new_action_info