<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"></head><bodyclass="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="sidebar-logo"href="../widgetry/index.html"><divclass="logo-container"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></div>
</a><h2class="location"><ahref="#">Crate widgetry</a></h2><divclass="sidebar-elems"><divclass="block"><ul><liclass="version">Version 0.1.0</li><li><aid="all-types"href="all.html">All Items</a></li></div></ul><section><divclass="block"><ul><li><ahref="#modules">Modules</a></li><li><ahref="#macros">Macros</a></li><li><ahref="#structs">Structs</a></li><li><ahref="#enums">Enums</a></li><li><ahref="#constants">Constants</a></li><li><ahref="#traits">Traits</a></li><li><ahref="#functions">Functions</a></li><li><ahref="#types">Type Definitions</a></li></ul></div></section><divid="sidebar-vars"data-name="widgetry"data-ty="mod"data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container"href="../widgetry/index.html"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></a><navclass="sub"><divclass="theme-picker hidden"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="22"height="22"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../wheel.svg"></a></div></form></nav></div><sectionid="main-content"class="content"><divclass="main-heading">
<h1class="fqn"><spanclass="in-band">Crate <aclass="mod"href="#">widgetry</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../clipboard.svg"width="19"height="18"alt="Copy item path"></button></span></h1><spanclass="out-of-band"><aclass="srclink"href="../src/widgetry/lib.rs.html#1-237">source</a> · <aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><h2id="widgets"><ahref="#widgets">Widgets</a></h2>
<p>If none of these do what you need, implementing a new <ahref="widgets/trait.WidgetImpl.html"title="WidgetImpl"><code>WidgetImpl</code></a> isn’t tough.</p>
<li><ahref="widgets/autocomplete/struct.Autocomplete.html"title="Autocomplete"><code>Autocomplete</code></a> - select predefined value by combining text entry with menus</li>
<li><ahref="widgets/button/struct.Button.html"title="Button"><code>Button</code></a> - clickable buttons with keybindings and tooltips</li>
<li><ahref="widgets/toggle/struct.Toggle.html"title="Toggle"><code>Toggle</code></a> - checkboxes, switches, and other toggles</li>
<li><ahref="widgets/compare_times/struct.CompareTimes.html"title="CompareTimes"><code>CompareTimes</code></a> - a scatter plot specialized for comparing times</li>
<li><ahref="widgets/just_draw/struct.DrawWithTooltips.html"title="DrawWithTooltips"><code>DrawWithTooltips</code></a> - draw static geometry, with mouse tooltips in certain regions</li>
<li><ahref="widgets/dropdown/struct.Dropdown.html"title="Dropdown"><code>Dropdown</code></a> - a button that expands into a menu</li>
<li><ahref="widgets/fan_chart/struct.FanChart.html"title="FanChart"><code>FanChart</code></a> - visualize a range of values over time</li>
<li><ahref="widgets/filler/struct.Filler.html"title="Filler"><code>Filler</code></a> - just carve out space in the layout for something else</li>
<li><ahref="widgets/just_draw/struct.JustDraw.html"title="JustDraw"><code>JustDraw</code></a> (argh private) - just draw text, <code>GeomBatch</code>es, SVGs</li>
<li><ahref="widgets/line_plot/struct.LinePlot.html"title="LinePlot"><code>LinePlot</code></a> - visualize 2 variables with a line plot</li>
<li><ahref="widgets/menu/struct.Menu.html"title="Menu"><code>Menu</code></a> - select something from a menu, with keybindings</li>
<li><ahref="widgets/persistent_split/struct.PersistentSplit.html"title="PersistentSplit"><code>PersistentSplit</code></a> - a button with a dropdown to change its state</li>
<li><ahref="widgets/scatter_plot/struct.ScatterPlot.html"title="ScatterPlot"><code>ScatterPlot</code></a> - visualize 2 variables with a scatter plot</li>
<li><ahref="widgets/slider/struct.Slider.html"title="Slider"><code>Slider</code></a> - horizontal and vertical sliders</li>
<li><ahref="widgets/spinner/struct.Spinner.html"title="Spinner"><code>Spinner</code></a> - numeric input with up/down buttons</li>
<li><ahref="table/struct.Table.html"title="table::Table"><code>table::Table</code></a> - rows and columns, supporting filtering and pagination</li>
<li><ahref="widgets/text_box/struct.TextBox.html"title="TextBox"><code>TextBox</code></a> - single line text entry</li>
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="mod"href="app_state/index.html"title="widgetry::app_state mod">app_state</a><spantitle="Restricted Visibility"> 🔒</span></div><divclass="item-right docblock-short"><p>A widgetry application splits its state into two pieces: global shared state that lasts for the
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="macro"href="macro.include_labeled_bytes.html"title="widgetry::include_labeled_bytes macro">include_labeled_bytes</a></div><divclass="item-right docblock-short"><p>Like <ahref="https://doc.rust-lang.org/1.61.0/core/macro.include_bytes.html"title="std::include_bytes!"><code>std::include_bytes!</code></a>, but also returns its argument, the relative path to the bytes</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.EdgeInsets.html"title="widgetry::EdgeInsets struct">EdgeInsets</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.EventCtx.html"title="widgetry::EventCtx struct">EventCtx</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.FanChart.html"title="widgetry::FanChart struct">FanChart</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Filler.html"title="widgetry::Filler struct">Filler</a></div><divclass="item-right docblock-short"><p>Doesn’t do anything by itself, just used for widgetsing. Something else reaches in, asks for the
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.GeomBatch.html"title="widgetry::GeomBatch struct">GeomBatch</a></div><divclass="item-right docblock-short"><p>A mutable builder for a group of colored polygons.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.GeomBatchStack.html"title="widgetry::GeomBatchStack struct">GeomBatchStack</a></div><divclass="item-right docblock-short"><p>Similar to [<code>Widget::row</code>]/[<code>Widget::column</code>], but for <ahref="geom/struct.GeomBatch.html"title="GeomBatch"><code>GeomBatch</code></a>s instead of [<code>Widget</code>]s,
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ScatterPlot.html"title="widgetry::ScatterPlot struct">ScatterPlot</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ScreenDims.html"title="widgetry::ScreenDims struct">ScreenDims</a></div><divclass="item-right docblock-short"><p>ScreenDims is in units of logical pixels, as opposed to physical pixels.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ScreenPt.html"title="widgetry::ScreenPt struct">ScreenPt</a></div><divclass="item-right docblock-short"><p>ScreenPt is in units of logical pixels, as opposed to physical pixels.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.ScreenRectangle.html"title="widgetry::ScreenRectangle struct">ScreenRectangle</a></div><divclass="item-right docblock-short"><p>ScreenRectangle is in units of logical pixels, as opposed to physical pixels.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Series.html"title="widgetry::Series struct">Series</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Settings.html"title="widgetry::Settings struct">Settings</a></div><divclass="item-right docblock-short"><p>Customize how widgetry works. Most of these settings can’t be changed after starting.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Slider.html"title="widgetry::Slider struct">Slider</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Spinner.html"title="widgetry::Spinner struct">Spinner</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="struct"href="struct.Stash.html"title="widgetry::Stash struct">Stash</a></div><divclass="item-right docblock-short"><p>An invisible widget that stores some arbitrary data on the Panel. Users of the panel can read
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.ClickOutcome.html"title="widgetry::ClickOutcome enum">ClickOutcome</a></div><divclass="item-right docblock-short"><p>When an action happens through a button-like widget, what data is plumbed back?</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.ContentMode.html"title="widgetry::ContentMode enum">ContentMode</a></div><divclass="item-right docblock-short"><p>Rules for how content should stretch to fill its bounds</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Key.html"title="widgetry::Key enum">Key</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.MultiKey.html"title="widgetry::MultiKey enum">MultiKey</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Outcome.html"title="widgetry::Outcome enum">Outcome</a></div><divclass="item-right docblock-short"><p>The result of a Panel handling an event</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.PanelDims.html"title="widgetry::PanelDims enum">PanelDims</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.RewriteColor.html"title="widgetry::RewriteColor enum">RewriteColor</a></div><divclass="item-right docblock-short"><p>A way to transform all colors in a GeomBatch.</p>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.StackAlignment.html"title="widgetry::StackAlignment enum">StackAlignment</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.StackAxis.html"title="widgetry::StackAxis enum">StackAxis</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="enum"href="enum.Transition.html"title="widgetry::Transition enum">Transition</a></div><divclass="item-right docblock-short"><p>When a state responds to an event, it can specify some way to manipulate the stack of states.</p>
<divclass="item-table"><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.SharedAppState.html"title="widgetry::SharedAppState trait">SharedAppState</a></div><divclass="item-right docblock-short"><p>Any data that should last the entire lifetime of the application should be stored in the struct
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.SimpleState.html"title="widgetry::SimpleState trait">SimpleState</a></div><divclass="item-right docblock-short"><p>Many states fit a pattern of managing a single panel, handling mouseover events, and other
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.State.html"title="widgetry::State trait">State</a></div><divclass="item-right docblock-short"><p>A temporary state of an application. There’s a stack of these, with the most recent being the
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.TextExt.html"title="widgetry::TextExt trait">TextExt</a></div><divclass="item-right docblock-short"></div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.WidgetImpl.html"title="widgetry::WidgetImpl trait">WidgetImpl</a></div><divclass="item-right docblock-short"><p>Create a new widget by implementing this trait. You can instantiate your widget by calling