context_menus
context_menus
¶
Context menus shared between editor views.
Attributes¶
Classes¶
Functions¶
build_nodes_context_menu(parent, has_selection, has_reference=False, with_util_objects=False)
¶
Build the node context menu used by both the tree and the graph views.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
QWidget
|
owner of the menu |
required |
has_selection
|
bool
|
whether nodes are selected; selection-only entries are hidden otherwise |
required |
has_reference
|
bool
|
whether a selected node is loaded from a stage file; the entries for those are hidden otherwise |
False
|
with_util_objects
|
bool
|
whether to offer creating notes and groups, which only the graph can show |
False
|
Source code in src/nyx/editor/utils/context_menus.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
build_util_object_context_menu(parent, gr_util)
¶
Build the context menu of a note, group or other util object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
QWidget
|
owner of the menu |
required |
gr_util
|
GraphicsUtilObject
|
item of the util object under the cursor |
required |
Source code in src/nyx/editor/utils/context_menus.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
show_menu(menu, global_pos)
¶
Show a menu at a position and wait until it is closed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
menu
|
QMenu
|
menu to show. |
required |
global_pos
|
QPoint
|
position in screen coordinates. |
required |
Source code in src/nyx/editor/utils/context_menus.py
10 11 12 13 14 15 16 17 | |