Skip to main content

RadioMenuFlyoutItem

A menu item for one of several options, of which only one can be chosen: the chosen one shows a dot.

Clicking it checks it and unchecks the other radio items of the same group in the same menu.

Example:

fluent.MenuFlyoutItem(
"View",
items=[
fluent.RadioMenuFlyoutItem("Large icons"),
fluent.RadioMenuFlyoutItem("Small icons", checked=True),
fluent.RadioMenuFlyoutItem("List"),
],
)

Inherits: Control

Properties

  • checked - Whether this option is chosen.
  • close_on_click - Whether clicking this item closes the menu.
  • content - The label of this item.
  • group - The name of the group of options this item belongs to.
  • trailing - Text or a control shown at the end of this item, typically a keyboard shortcut.

Events

  • on_change - Called when the user chooses this option.

Properties​

checkedclass-attributeinstance-attribute​

checked: bool = False

Whether this option is chosen.

close_on_clickclass-attributeinstance-attribute​

close_on_click: bool = True

Whether clicking this item closes the menu.

contentinstance-attribute​

content: StrOrControl

The label of this item.

groupclass-attributeinstance-attribute​

group: str | None = None

The name of the group of options this item belongs to.

Items with the same group in the same menu, including None, form one group. Use different groups for several sets of options in one menu.

trailingclass-attributeinstance-attribute​

trailing: StrOrControl | None = None

Text or a control shown at the end of this item, typically a keyboard shortcut.

Events​

on_changeclass-attributeinstance-attribute​

on_change: (
    ControlEventHandler[RadioMenuFlyoutItem] | None
) = None

Called when the user chooses this option.

checked is True, and the other items of the group are unchecked, before this is called.