mirror of
https://github.com/italicsjenga/muda.git
synced 2025-01-26 02:56:34 +11:00
chore: update docs
This commit is contained in:
parent
a999fb1d03
commit
e5324b7684
2 changed files with 9 additions and 10 deletions
15
README.md
15
README.md
|
@ -56,15 +56,15 @@ let submenu = Submenu::with_items("Submenu Outer", true,&[
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then Add your root menu to a Window on Windows and Linux Only or use it
|
Then add your root menu to a Window on Windows and Linux
|
||||||
as your global app menu on macOS
|
or use it as your global app menu on macOS
|
||||||
|
|
||||||
```rs
|
```rs
|
||||||
// --snip--
|
// --snip--
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
menu.init_for_hwnd(window.hwnd() as isize);
|
menu.init_for_hwnd(window.hwnd() as isize);
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
menu.init_for_gtk_window(>k_window);
|
menu.init_for_gtk_window(>k_window, Some(&vertical_gtk_box));
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
menu.init_for_nsapp();
|
menu.init_for_nsapp();
|
||||||
```
|
```
|
||||||
|
@ -75,14 +75,13 @@ You can also use a [`Menu`] or a [`Submenu`] show a context menu.
|
||||||
|
|
||||||
```rs
|
```rs
|
||||||
// --snip--
|
// --snip--
|
||||||
let x = 100;
|
let position = muda::PhysicalPosition { x: 100., y: 120. };
|
||||||
let y = 120;
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
menu.show_context_menu_for_hwnd(window.hwnd() as isize, x, y);
|
menu.show_context_menu_for_hwnd(window.hwnd() as isize, Some(position.into()));
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
menu.show_context_menu_for_gtk_window(>k_window, x, y);
|
menu.show_context_menu_for_gtk_window(>k_window, Some(position.into()));
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
menu.show_context_menu_for_nsview(nsview, x, y);
|
menu.show_context_menu_for_nsview(nsview, Some(position.into()));
|
||||||
```
|
```
|
||||||
|
|
||||||
## Processing menu events
|
## Processing menu events
|
||||||
|
|
|
@ -68,8 +68,8 @@
|
||||||
//! );
|
//! );
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
//! Then Add your root menu to a Window on Windows and Linux Only or use it
|
//! Then add your root menu to a Window on Windows and Linux
|
||||||
//! as your global app menu on macOS
|
//! or use it as your global app menu on macOS
|
||||||
//!
|
//!
|
||||||
//! ```no_run
|
//! ```no_run
|
||||||
//! # let menu = muda::Menu::new();
|
//! # let menu = muda::Menu::new();
|
||||||
|
|
Loading…
Add table
Reference in a new issue