Source code for bokeh.models.ui.menus

#-----------------------------------------------------------------------------
# Copyright (c) Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------
""" Various kinds of menus. """

#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import annotations

import logging # isort:skip
log = logging.getLogger(__name__)

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

# Standard library imports
from typing import Any

# Bokeh imports
from ...core.properties import (
    Bool,
    Either,
    Instance,
    List,
    Null,
    Nullable,
    Required,
    String,
)
from ...core.property_aliases import IconLike
from ...model import Model
from ...util.deprecation import deprecated
from ..callbacks import Callback
from .ui_element import UIElement

#-----------------------------------------------------------------------------
# Globals and constants
#-----------------------------------------------------------------------------

__all__ = (
    "ActionItem",
    "CheckableItem",
    "DividerItem",
    "Menu",
    "MenuItem",
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------




[docs] class ActionItem(MenuItem): # explicit __init__ to support Init signatures def __init__(self, *args: Any, **kwargs: Any) -> None: deprecated((3, 7, 0), "ActionItem", "MenuItem") super().__init__(*args, **kwargs)
[docs] class CheckableItem(MenuItem): """ A two state checkable menu item. """ # explicit __init__ to support Init signatures def __init__(self, *args: Any, **kwargs: Any) -> None: deprecated((3, 7, 0), "CheckableItem", "ActionItem.checked") super().__init__(*args, **kwargs)
[docs] class DividerItem(Model): """ A dividing line between two groups of menu items. """ # explicit __init__ to support Init signatures def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs)
#----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Code #-----------------------------------------------------------------------------