chore: update docs

This commit is contained in:
Amr Bashir 2023-07-28 04:38:38 +03:00
parent a999fb1d03
commit e5324b7684
No known key found for this signature in database
GPG key ID: BBD7A47A2003FF33
2 changed files with 9 additions and 10 deletions

View file

@ -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(&gtk_window); menu.init_for_gtk_window(&gtk_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(&gtk_window, x, y); menu.show_context_menu_for_gtk_window(&gtk_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

View file

@ -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();