pub struct Response {
pub clicked: bool,
pub hovered: bool,
pub changed: bool,
pub focused: bool,
pub rect: Rect,
}Expand description
Interaction response returned by all widgets.
Container methods return a Response. Check .clicked, .changed, etc.
to react to user interactions.
rect is meaningful after the widget has participated in layout.
Container responses describe the container’s own interaction area, not
automatically the focus state of every child widget.
§Examples
let r = ui.row(|ui| {
ui.text("Save");
});
if r.clicked {
// handle save
}Fields§
§clicked: boolWhether the widget was clicked this frame.
hovered: boolWhether the mouse is hovering over the widget.
changed: boolWhether the widget’s value changed this frame.
focused: boolWhether the widget currently has keyboard focus.
rect: RectThe rectangle the widget occupies after layout.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more