From e5324b76840dbe7414107ad4a1ea35296a63b425 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Fri, 28 Jul 2023 04:38:38 +0300 Subject: [PATCH] chore: update docs --- README.md | 15 +++++++-------- src/lib.rs | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 772540e..29b1d90 100644 --- a/README.md +++ b/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 diff --git a/src/lib.rs b/src/lib.rs index c906262..1e76d1f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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();