Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Pie Menu Editor 2.4 documentation
Pie Menu Editor 2.4 documentation

Getting Started

  • Installation
  • Create Your First Pie Menu
  • Examples & Ideas
    • Code Examples

Editors

  • Common Editor Elements
  • Hotkey Mode
  • Pie Menu Editor
  • Vector Menu Editor
  • Regular Menu Editor
  • Pop-up Dialog Editor
  • Floating Panel Editor
  • Sticky Key Editor
  • Stack Key Editor
  • Macro Operator Editor
  • Modal Operator Editor
  • Property Editor
  • Property Stack Editor
  • Context Router Editor
  • Side Panel Editor
  • Hiding Unused Panels
  • Interactive Panels and Extend Panel
  • UI Customization
  • Capture Menu
  • Custom Icons
  • Settings

Scripting

  • Writing and Running Code
  • Scripting Reference
  • Managing Scripts
  • Bundled Utilities
  • Context Browser

Authoring API

  • Overview
    • Concepts
    • Results and guards
    • Menus
    • Slots
    • Layout rows and panels
    • Menu type settings
    • Hotkeys
    • Property
    • Property Stack
    • Context Router
    • Export and validation
    • Resources
    • Execution, user properties and identity
    • Recipes
      • Build a panel row by row
      • Author a Property Stack and show its state
      • Turn a setting into a Property switch
      • Add a Router branch and edit its condition
      • Link a child menu and keep its icon flags

Reference

  • Choosing a Keymap
  • Keymap Conflicts
  • Poll Method
  • Glossary
  • File Locations
  • Boot Options
  • Developer Options
  • Video Tutorials

Support

  • FAQ
  • Known Issues
  • Support
  • Change Log
🇺🇸 🇯🇵
Back to top
View this page

Link a child menu and keep its icon flags¶

Turn an existing slot into a link to a child menu with a new icon, keeping the slot’s label, presentation and icon flags.

  1. Read the child menu’s UID from read_pm() or the menu list. Do not construct it.

  2. Read the slot and split its icon flags (#, !, ^) from the icon name.

  3. Save the link and the new icon name with the old flags.

before = pme.editing.read_pm(pm_uid, slot_uids=[slot_uid])
slot = before["slots"][0]
# Keep the leading flags and replace only the icon name.
old_icon = slot["icon"]
icon_flags = old_icon[:len(old_icon) - len(old_icon.lstrip("#!^"))]
result = pme.editing.update_slots(
    pm_uid,
    {slot_uid: {
        "mode": "MENU",
        "menu_target_uid": child_uid,
        "icon": icon_flags + "TOOL_SETTINGS",
        "auto_icon": False,
    }},
    expected_version=before["version"],
    expected={slot_uid: slot},
)
assert result["status"] == "committed", result
  • Choose an icon that fits the child’s category. A Vector Menu draws its own Nest arrow.

  • For an icon-only edit, leave mode and menu_target_uid out. The presentation settings stay as saved; a Submenu does not need to become a Button to change its icon.

  • menu_presentation is the placement of a linked Regular Menu. Nest gestures and Pie Menu confirmation settings are separate settings.

Check¶

  • result["slots"][0]["after"] has mode "MENU", target_pm_uid equal to child_uid, and icon starting with the old flags.

  • In the intended menu, the displayed icon, entering the child, selecting in it, and leaving it work as intended.

Functions used: read_pm(), update_slots(). Icon values are described in Icon value, Menu slot text in Menu slot text.

Next
Choosing a Keymap
Previous
Add a Router branch and edit its condition
Copyright © 2025, Pluglug and contributors
Made with Sphinx and @pradyunsg's Furo
On this page
  • Link a child menu and keep its icon flags
    • Check