mirror of
https://github.com/italicsjenga/muda.git
synced 2024-12-23 12:01:31 +11:00
chore: update docs
This commit is contained in:
parent
a999fb1d03
commit
e5324b7684
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
|
||||
as your global app menu on macOS
|
||||
Then add your root menu to a Window on Windows and Linux
|
||||
or use it as your global app menu on macOS
|
||||
|
||||
```rs
|
||||
// --snip--
|
||||
#[cfg(target_os = "windows")]
|
||||
menu.init_for_hwnd(window.hwnd() as isize);
|
||||
#[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")]
|
||||
menu.init_for_nsapp();
|
||||
```
|
||||
|
@ -75,14 +75,13 @@ You can also use a [`Menu`] or a [`Submenu`] show a context menu.
|
|||
|
||||
```rs
|
||||
// --snip--
|
||||
let x = 100;
|
||||
let y = 120;
|
||||
let position = muda::PhysicalPosition { x: 100., y: 120. };
|
||||
#[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")]
|
||||
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")]
|
||||
menu.show_context_menu_for_nsview(nsview, x, y);
|
||||
menu.show_context_menu_for_nsview(nsview, Some(position.into()));
|
||||
```
|
||||
|
||||
## Processing menu events
|
||||
|
|
|
@ -68,8 +68,8 @@
|
|||
//! );
|
||||
//! ```
|
||||
//!
|
||||
//! Then Add your root menu to a Window on Windows and Linux Only or use it
|
||||
//! as your global app menu on macOS
|
||||
//! Then add your root menu to a Window on Windows and Linux
|
||||
//! or use it as your global app menu on macOS
|
||||
//!
|
||||
//! ```no_run
|
||||
//! # let menu = muda::Menu::new();
|
||||
|
|
Loading…
Reference in a new issue