Skip to main content

NativeMenuController

Trait NativeMenuController 

Source
pub trait NativeMenuController {
    // Required methods
    fn set_item_enabled(&self, id: u64, enabled: bool);
    fn set_item_checked(&self, id: u64, checked: bool);
    fn set_visible(&self, visible: bool);
}
Expand description

已安装原生菜单的运行期控制器。

由 WindowShell::native_menu 返回;未知 id 应被忽略而不是 panic。

Required Methods§

Source

fn set_item_enabled(&self, id: u64, enabled: bool)

Source

fn set_item_checked(&self, id: u64, checked: bool)

Source

fn set_visible(&self, visible: bool)

显示/隐藏菜单栏。Windows 为真正移除/重新挂载;macOS 会安装空菜单 (系统全局菜单栏无法完全隐藏)。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§