<!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 - 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><scriptdefersrc="../main.js"></script>
<noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="alternate icon"type="image/png"href="../favicon-16x16.png"><linkrel="alternate icon"type="image/png"href="../favicon-32x32.png"><linkrel="icon"type="image/svg+xml"href="../favicon.svg"><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_find_widget">maybe_find_widget</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.restore_scroll">restore_scroll</a><ahref="#method.scroll_offset">scroll_offset</a><ahref="#method.scroll_to_member">scroll_to_member</a><ahref="#method.set_checked">set_checked</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
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.stash"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/widgetry/widgets/panel.rs.html#465-467"title="goto source code">[src]</a></div><ahref="#method.stash"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.stash"class="fnname">stash</a><T: 'static>(&self, name: &<aclass="primitive"href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>) -><aclass="struct"href="https://doc.rust-lang.org/1.58.1/alloc/rc/struct.Rc.html"title="struct alloc::rc::Rc">Rc</a><<aclass="struct"href="https://doc.rust-lang.org/1.58.1/core/cell/struct.RefCell.html"title="struct core::cell::RefCell">RefCell</a><T>></h4></div></summary><divclass="docblock"><p>Grab a stashed value, with the ability to pass it around and modify it.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.clone_stashed"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/widgetry/widgets/panel.rs.html#470-472"title="goto source code">[src]</a></div><ahref="#method.clone_stashed"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.clone_stashed"class="fnname">clone_stashed</a><T: 'static + <aclass="trait"href="https://doc.rust-lang.org/1.58.1/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>>(&self, name: &<aclass="primitive"href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>) -> T</h4></div></summary><divclass="docblock"><p>Grab a stashed value and clone it.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><divid="method.take"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/widgetry/widgets/panel.rs.html#566-568"title="goto source code">[src]</a></div><ahref="#method.take"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.take"class="fnname">take</a>(&mut self, id: &<aclass="primitive"href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>) -><aclass="struct"href="widgets/struct.Widget.html"title="struct widgetry::widgets::Widget">Widget</a></h4></div></summary><divclass="docblock"><p>Removes a widget from the panel. Does not recalculate layout!</p>
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"open><summary><divid="impl-TryFrom%3CU%3E"class="impl has-srclink"><divclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#587-596"title="goto source code">[src]</a></div><ahref="#impl-TryFrom%3CU%3E"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.58.1/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.58.1/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.Error"class="type trait-impl has-srclink"><ahref="#associatedtype.Error"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error"class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.58.1/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></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"><divclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#593"title="goto source code">[src]</a></div><ahref="#method.try_from"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#tymethod.try_from"class="fnname">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.58.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><divclass='docblock'><p>Performs the conversion.</p>
</div></details></div></details><detailsclass="rustdoc-toggle implementors-toggle"open><summary><divid="impl-TryInto%3CU%3E"class="impl has-srclink"><divclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#573-582"title="goto source code">[src]</a></div><ahref="#impl-TryInto%3CU%3E"class="anchor"></a><h3class="code-header in-band">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.58.1/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.58.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.Error-1"class="type trait-impl has-srclink"><ahref="#associatedtype.Error-1"class="anchor"></a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryInto.html#associatedtype.Error"class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></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"><divclass="rightside"><aclass="srclink"href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#579"title="goto source code">[src]</a></div><ahref="#method.try_into"class="anchor"></a><h4class="code-header">pub fn <ahref="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryInto.html#tymethod.try_into"class="fnname">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.58.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><divclass='docblock'><p>Performs the conversion.</p>