Fix incorrect documentation for Response::context_menu

Closes https://github.com/emilk/egui/issues/1882
This commit is contained in:
Emil Ernerfeldt 2022-08-03 08:26:42 +02:00
parent bcc01c8b1c
commit cb0d5a58ab

View file

@ -524,8 +524,9 @@ impl Response {
/// Response to secondary clicks (right-clicks) by showing the given menu. /// Response to secondary clicks (right-clicks) by showing the given menu.
/// ///
/// ``` /// ```
/// # use egui::{Label, Sense};
/// # egui::__run_test_ui(|ui| { /// # egui::__run_test_ui(|ui| {
/// let response = ui.label("Right-click me!"); /// let response = ui.add(Label::new("Right-click me!").sense(Sense::click()));
/// response.context_menu(|ui| { /// response.context_menu(|ui| {
/// if ui.button("Close the menu").clicked() { /// if ui.button("Close the menu").clicked() {
/// ui.close_menu(); /// ui.close_menu();