Menu Utilities for Desktop Applications in Rust.

Last update: May 8, 2022

muda

Menu Utilities for Desktop Applications.

Example

Create the root menu and add submenus and men items.

let mut menu = Menu::new();

let file_menu = menu.add_submenu("File", true);
let open_item = file_menu.add_text_item("Open", true);
let save_item = file_menu.add_text_item("Save", true);

let edit_menu = menu.add_submenu("Edit", true);
let copy_item = file_menu.add_text_item("Copy", true);
let cut_item = file_menu.add_text_item("Cut", true);

#[cfg(target_os = "windows")]
menu.init_for_hwnd(window.hwnd() as isize);
#[cfg(target_os = "linux")]
menu.init_for_gtk_window(&gtk_window);
#[cfg(target_os = "macos")]
menu.init_for_nsapp();

Then listen for the events

if let Ok(event) = menu_event_receiver().try_recv() {
    match event.id {
        _ if event.id == save_item.id() => {
            println!("Save menu item activated");
        },
        _ => {}
    }
}

GitHub

https://github.com/amrbashir/muda
You might also like...

A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

Dec 13, 2021

Lists Steam applications that have specified a Steam Play compatibility tool

proton-usage Lists Steam applications that have specified a Steam Play compatibility tool. Useful for when you want to remove/uninstall unused compati

May 18, 2022

Upkeep your websites and web applications with ease from the comfort of the command line.

Upkeep your websites and web applications with ease from the comfort of the command line.

Upkeep Upkeep your websites and web applications with ease from the comfort of the command line. Explore the docs » View Demo · Report Bug · Request F

Dec 24, 2021

Build light & secure cross-platform applications with a web-based UI

Build light & secure cross-platform applications with a web-based UI

Millennium Icon by XFaon. *Stats are from Tauri and may not be fully accurate. Millennium is a cross-platform webview framework written in Rust. With

May 20, 2022

Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust-advent - Learning Rust by solving advent of code challenges (Streaming live on Twitch every Monday)

Rust advent 🦀 🐚 Learning Rust by implementing solutions for Advent of Code problems. 🎥 HEY, we are live-streaming our attempts to solve the exercis

Jan 10, 2022

Rust-clippy - A bunch of lints to catch common mistakes and improve your Rust code

Clippy A collection of lints to catch common mistakes and improve your Rust code. There are over 450 lints included in this crate! Lints are divided i

May 26, 2022

Rust-battery - Rust crate providing cross-platform information about the notebook batteries.

battery Rust crate providing cross-platform information about the notebook batteries. Table of contents Overview Supported platforms Install Examples

Apr 17, 2022

A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Apr 10, 2022

A full featured, fast Command Line Argument Parser for Rust

clap Command Line Argument Parser for Rust It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcomma

May 27, 2022
Comments
  • 1. Implement macOS Submenu `label`, `enabled`

    Enabled state can be toggled through the NSMenuItem from the submenu.

    If submenu is attached to the menubar, label is affected by NSMenu. When the submenu is added inside another submenu, label is affected by NSMenuItem.

    Reviewed by pewsheen at 2022-05-19 16:24
Related tags
A lightweight terminal menu for Rust
A lightweight terminal menu for Rust

youchoose A simple, easy to use command line menu for Rust. Usage There are two methods you need to be familiar with to get started: Menu::new which t

May 26, 2022
A small utility that moves the start menu to the top-center of the screen in Windows 11.
A small utility that moves the start menu to the top-center of the screen in Windows 11.

TopCenterStart11 A small utility that moves the start menu to the top-center of the screen in Windows 11. As of right now, this application can only p

May 13, 2022
argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper with a

argmax argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper w

Apr 21, 2022
Update informer for CLI applications written in Rust 🦀

Update-informer Update informer for CLI applications written in Rust ?? Usage Add to Cargo.toml: [dependencies] update-notifier = "0.1.0" To check the

May 26, 2022
A strong, compile-time enforced authorization framework for rust applications.

DACquiri A compile-time enforced authorization framework for Rust applications. Authorization In typical applications, authorization checks are perfor

May 2, 2022
Terminal plotting library for using in Rust CLI applications
Terminal plotting library for using in Rust CLI applications

textplots Terminal plotting library for using in Rust CLI applications. Should work well in any unicode terminal with monospaced font. It is inspired

May 18, 2022
CarLI is a framework for creating single-command and multi-command CLI applications in Rust

CarLI is a framework for creating single-command and multi-command CLI applications in Rust. The framework provides error and IO types better suited for the command line environment, especially in cases where unit testing is needed.

Jan 21, 2022
create and test the style and formatting of text in your terminal applications
 create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Jul 3, 2021
Pixel-perfect integer scaling for windowed applications

integer-fullscreen Pixel-perfect integer scaling for windowed applications. Usage Run the program. Move your cursor to a window you would like to get

May 23, 2021
A tool for automating terminal applications in Unix.

expectrl A tool for automating terminal applications in Unix. Using the library you can: Spawn process Control process Expect/Verify responces It was

May 17, 2022