From 43ea9a96930520f0bbbae2db1d6633449964b55a Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Fri, 13 Apr 2018 14:19:23 +0000 Subject: [PATCH] Wrap BeginGroup / EndGroup --- src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index b7b63bb..33ca86c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1166,4 +1166,13 @@ impl<'ui> Ui<'ui> { sys::igIsItemActive() } } + + /// Group items together as a single item. + /// + /// May be useful to handle the same mouse event on a group of items, for example. + pub fn group(&self, f: F) { + unsafe { sys::igBeginGroup(); } + f(); + unsafe { sys::igEndGroup(); } + } }