From 497a360409a52508274b012a9ebe93c864919a6b Mon Sep 17 00:00:00 2001 From: onkarrai06 Date: Tue, 5 Sep 2023 16:46:06 +0500 Subject: [PATCH] library: Ported Popover in RUST --- src/Library/demos/Popovers/code.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/Library/demos/Popovers/code.rs diff --git a/src/Library/demos/Popovers/code.rs b/src/Library/demos/Popovers/code.rs new file mode 100644 index 000000000..2d4a1b003 --- /dev/null +++ b/src/Library/demos/Popovers/code.rs @@ -0,0 +1,15 @@ +use crate::workbench; +use gtk::prelude::*; + +pub fn main() { + let popover_ids = ["plain_popover", "popover_menu"]; + + for id in popover_ids { + let popover: gtk::Popover = workbench::builder().object(id).unwrap(); + + popover.connect_closed(move |popover| { + let popover_name = popover.name(); + println!("{} closed.", popover_name); + }); + } +}