<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `Panel` struct in crate `widgetry`."><metaname="keywords"content="rust, rustlang, rust-lang, Panel"><title>Panel in widgetry::widgets::panel - Rust</title><linkrel="stylesheet"type="text/css"href="../../../normalize.css"><linkrel="stylesheet"type="text/css"href="../../../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../../../light.css"id="themeStyle"><linkrel="stylesheet"type="text/css"href="../../../dark.css"disabled><linkrel="stylesheet"type="text/css"href="../../../ayu.css"disabled><scriptid="default-settings"></script><scriptsrc="../../../storage.js"></script><scriptsrc="../../../crates.js"></script><noscript><linkrel="stylesheet"href="../../../noscript.css"></noscript><linkrel="icon"type="image/svg+xml"href="../../../favicon.svg">
<linkrel="alternate icon"type="image/png"href="../../../favicon-32x32.png"><styletype="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu"role="button">☰</div><ahref='../../../widgetry/index.html'><divclass='logo-container rust-logo'><imgsrc='../../../rust-logo.png'alt='logo'></div></a><h2class="location">Struct Panel</h2><divclass="sidebar-elems"><divclass="block items"><h3class="sidebar-title"><ahref="#fields">Fields</a></h3><divclass="sidebar-links"><ahref="#structfield.cached_flexbox">cached_flexbox</a><ahref="#structfield.clip_rect">clip_rect</a><ahref="#structfield.container_dims">container_dims</a><ahref="#structfield.contents_dims">contents_dims</a><ahref="#structfield.dims">dims</a><ahref="#structfield.horiz">horiz</a><ahref="#structfield.scrollable_x">scrollable_x</a><ahref="#structfield.scrollable_y">scrollable_y</a><ahref="#structfield.top_level">top_level</a><ahref="#structfield.vert">vert</a></div><h3class="sidebar-title"><ahref="#implementations">Methods</a></h3><divclass="sidebar-links"><ahref="#method.align">align</a><ahref="#method.autocomplete_done">autocomplete_done</a><ahref="#method.center_of">center_of</a><ahref="#method.center_of_panel">center_of_panel</a><ahref="#method.clicked_outside">clicked_outside</a><ahref="#method.clone_stashed">clone_stashed</a><ahref="#method.compute_flexbox">compute_flexbox</a><ahref="#method.currently_hovering">currently_hovering</a><ahref="#method.draw">draw</a><ahref="#method.dropdown_value">dropdown_value</a><ahref="#method.empty">empty</a><ahref="#method.event">event</a><ahref="#method.find">find</a><ahref="#method.find_mut">find_mut</a><ahref="#method.get_all_click_actions">get_all_click_actions</a><ahref="#method.has_widget">has_widget</a><ahref="#method.invalidate_flexbox">invalidate_flexbox</a><ahref="#method.is_button_enabled">is_button_enabled</a><ahref="#method.is_checked">is_checked</a><ahref="#method.maybe_dropdown_value">maybe_dropdown_value</a><ahref="#method.maybe_find">maybe_find</a><ahref="#method.maybe_is_checked">maybe_is_checked</a><ahref="#method.modify_spinner">modify_spinner</a><ahref="#method.new_builder">new_builder</a><ahref="#method.panel_dims">panel_dims</a><ahref="#method.persistent_split_value">persistent_split_value</a><ahref="#method.recompute_layout">recompute_layout</a><ahref="#method.recompute_layout_if_needed">recompute_layout_if_needed</a><ahref="#method.recompute_scrollbar_layout">recompute_scrollbar_layout</a><ahref="#method.rect_of">rect_of</a><ahref="#method.replace">replace</a><ahref="#method.restore">restore</a><ahref="#method.scroll_offset">scroll_offset</a><ahref="#method.scroll_to_member">scroll_to_member</a><ahref="#method.set_scroll_offset">set_scroll_offset</a><ahref="#method.slider">slider</a><ahref="#method.slider_mut">slider_mut</a><ahref="#method.spinner">spinner</a><ahref="#method.stash">stash</a><ahref="#method.swap_inner_content">swap_inner_content</a><ahref="#method.take">take</a><ahref="#method.take_menu_choice">take_menu_choice</a><ahref="#method.text_box">text_box</a><ahref="#method.update_container_dims_for_canvas_dims">update_container_dims_for_canvas_dims</a><ahref="#method.update_scroll_sliders">update_scroll_sliders</a></div><h3class="sidebar-title"><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><divclass="sidebar-links"><ahref="#impl-RefUnwindSafe">!RefUnwindSafe</a><ahref="#impl-Send">!Send</a><ahref="#impl-Sync">!Sync</a><ahref="#impl-Unpin">Unpin</a><ahref="#impl-UnwindSafe">!UnwindSafe</a></div><h3class="sidebar-title"><ahref="#blanket-implementations">Blanket Implementations</a></h3><divclass="sidebar-links"><ahref="#impl-Any">Any</a><ahref="#impl-Borrow%3CT%3E">Borrow<T></a><ahref="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><ahref="
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.take"class="method has-srclink"><h4class="code-header">pub fn <ahref="#method.take"class="fnname">take</a>(&mut self, id: &<aclass="primitive"href="https://doc.rust-lang.org/1.54.0/std/primitive.str.html">str</a>) -><aclass="struct"href="../struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></h4><ahref="#method.take"class="anchor"></a><aclass="srclink"href="../../../src/widgetry/widgets/panel.rs.html#547-549"title="goto source code">[src]</a></div></summary><divclass="docblock"><p>Removes a widget from the panel. Does not recalculate layout!</p>
</div></details><divid="method.clicked_outside"class="method has-srclink"><h4class="code-header">pub fn <ahref="#method.clicked_outside"class="fnname">clicked_outside</a>(&self, ctx: &mut <aclass="struct"href="../../event_ctx/struct.EventCtx.html"title="struct widgetry::event_ctx::EventCtx">EventCtx</a><'_>) -><aclass="primitive"href="https://doc.rust-lang.org/1.54.0/std/primitive.bool.html">bool</a></h4><ahref="#method.clicked_outside"class="anchor"></a><aclass="srclink"href="../../../src/widgetry/widgets/panel.rs.html#551-554"title="goto source code">[src]</a></div><divid="method.currently_hovering"class="method has-srclink"><h4class="code-header">pub fn <ahref="#method.currently_hovering"class="fnname">currently_hovering</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.54.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="struct"href="https://doc.rust-lang.org/1.54.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></h4><ahref="#method.currently_hovering"class="anchor"></a><aclass="srclink"href="../../../src/widgetry/widgets/panel.rs.html#556-558"title="goto source code">[src]</a></div></div></details><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor"></a></h2><divid="synthetic-implementations-list"><divid="impl-RefUnwindSafe"class="impl has-srclink"><h3class="code-header in-band">impl !<aclass="trait"href="https://doc.rust-lang.org/1.54.0/std/panic/trait.RefUnwindSafe.html"title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="struct.Panel.html"title="struct widgetry::widgets::panel::Panel">Panel</a></h3><ahref="#impl-RefUnwindSafe"class="anchor"></a></div><divid="impl-Send"class="impl has-srclink"><h3class="code-header in-band">impl !<aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Panel.html"title="struct widgetry::widgets::panel::Panel">Panel</a></h3><ahref="#impl-Send"class="anchor"></a></div><divid="impl-Sync"class="impl has-srclink"><h3class="code-header in-band">impl !<aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="struct.Panel.html"title="struct widgetry::widgets::panel::Panel">Panel</a></h3><ahref="#impl-Sync"class="anchor"></a></div><divid="impl-Unpin"class="impl has-srclink"><h3class="code-header in-band">impl <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="struct.Panel.html"title="struct widgetry::widgets::panel::Panel">Panel</a></h3><ahref="#impl-Unpin"class="anchor"></a></div><divid="impl-UnwindSafe"class="impl has-srclink"><h3class="code-header in-band">impl !<aclass="trait"href="https://doc.rust-lang.org/1.54.0/std/panic/trait.UnwindSafe.html"title="trait std::panic::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="struct.Panel.html"title="struct widgetry::widgets::panel::Panel">Panel</a></h3><ahref="#impl-UnwindSafe"class="anchor"></a></div></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor"></a></h2><divid="blanket-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-Any"class="impl has-srclink"><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br> T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3><ahref="#impl-Any"class="anchor"></a><aclass="srcli
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-Borrow%3CT%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3><ahref="#impl-Borrow%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#208-213"title="goto source code">[src]</a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.borrow"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fnname">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.54.0/std/primitive.reference.html">&</a>T</h4><ahref="#method.borrow"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#210"title="goto source code">[src]</a></div></summary><divclass='docblock'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.54.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-BorrowMut%3CT%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></h3><ahref="#impl-BorrowMut%3CT%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#216-220"title="goto source code">[src]</a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.borrow_mut"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fnname">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.54.0/std/primitive.reference.html">&mut </a>T</h4><ahref="#method.borrow_mut"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/borrow.rs.html#217"title="goto source code">[src]</a></div></summary><divclass='docblock'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.54.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-Downcast"class="impl has-srclink"><h3class="code-header in-band">impl<T> Downcast for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a>, </span></h3><ahref="#impl-Downcast"class="anchor"></a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.into_any"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="#tymethod.into_any"class="fnname">into_any</a>(self: <aclass="struct"href="https://doc.rust-lang.org/1.54.0/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><T, <aclass="struct"href="https://doc.rust-lang.org/1.54.0/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>>) -><aclass="struct"href="https://doc.rust-lang.org/1.54.0/alloc/boxed/struct.Box.html"title="struct alloc::boxed::Box">Box</a><dyn <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/any/trait.Any.html"title="trait core::any::Any">Any</a> + 'static, <aclass="struct"href="https://doc.rust-lang.org/1.54.0/alloc/alloc/struct.Global.html"title="struct alloc::alloc::Global">Global</a>></h4><ahref="#method.into_any"class="anchor"></a></div></summary><divclass='docblock'><p>Convert <code>Box<dyn Trait></code> (where <code>Trait: Downcast</code>) to <code>Box<dyn Any></code>. <code>Box<dyn Any></code> can
then be further <code>downcast</code> into <code>Box<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <ahref="#tymethod.into_any">Read more</a></p>
further <code>downcast</code> into <code>Rc<ConcreteType></code> where <code>ConcreteType</code> implements <code>Trait</code>. <ahref="#tymethod.into_any_rc">Read more</a></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-Into%3CU%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T>, </span></h3><ahref="#impl-Into%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#533-540"title="goto source code">[src]</a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.into"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html#tymethod.into"class="fnname">into</a>(self) -> U</h4><ahref="#method.into"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#537"title="goto source code">[src]</a></div></summary><divclass='docblock'><p>Performs the conversion.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-Same%3CT%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T> Same<T> for T</h3><ahref="#impl-Same%3CT%3E"class="anchor"></a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.Output"class="type trait-impl has-srclink"><h4class="code-header">type <ahref="#associatedtype.Output"class="type">Output</a> = T</h4><ahref="#associatedtype.Output"class="anchor"></a></div></summary><divclass='docblock'><p>Should always be <code>Self</code></p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-TryFrom%3CU%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></h3><ahref="#impl-TryFrom%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#581-590"title="goto source code">[src]</a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.Error"class="type trait-impl has-srclink"><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.54.0/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4><ahref="#associatedtype.Error"class="anchor"></a></div></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.try_from"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4><ahref="#method.try_from"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#587"title="goto source code">[src]</a></div></summary><divclass='docblock'><p>Performs the conversion.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"><summary><divid="impl-TryInto%3CU%3E"class="impl has-srclink"><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#567-576"title="goto source code">[src]</a></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.Error-1"class="type trait-impl has-srclink"><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#associatedtype.Error"class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4><ahref="#associatedtype.Error-1"class="anchor"></a></div></summary><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.try_into"class="method trait-impl has-srclink"><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.54.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/1.54.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4><ahref="#method.try_into"class="anchor"></a><aclass="srclink"href="https://doc.rust-lang.org/1.54.0/src/core/convert/mod.rs.html#573"title="goto source code">[src]</a></div></summary><divclass='docblock'><p>Performs the conversion.</p>