<!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="Widgets"><metaname="keywords"content="rust, rustlang, rust-lang, widgetry"><title>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><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="icon"type="image/svg+xml"href="../favicon.svg"><linkrel="alternate icon"type="image/png"href="../favicon-16x16.png"><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 mod crate"><!--[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">Crate widgetry</h2><divclass="block version"><divclass="narrow-helper"></div><p>Version 0.1.0</p></div><divclass="sidebar-elems"><aid="all-types"href="all.html"><p>See all widgetry's items</p></a><divclass="block items"><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><divid="sidebar-vars"data-name="widgetry"data-ty="mod"data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="18"height="18"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><navclass="sub"><formclass="search-form"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input"name="search"disabledautocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"></div><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="18"height="18"alt="Change settings"src="../wheel.svg"></a></div></form></nav><sectionid="main"class="content"><h1class="fqn"><spanclass="in-band">Crate <aclass="mod"href="#">widgetry</a><buttonid="copy-path"onclick="copy_path(this)"title="copy path"><imgsrc="../clipboard.svg"width="19"height="18"alt="Copy item import"title="Copy item import to clipboard"></button></span><spanclass="out-of-band"><spanid="render-detail"><aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span><aclass="srclink"href="../src/widgetry/lib.rs.html#1-232"title="goto source code">[src]</a></span></h1><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><h1id="widgets"class="section-header"><ahref="#widgets">Widgets</a></h1>
<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-left module-item"><aclass="mod"href="app_state/index.html"title="widgetry::app_state mod">app_state</a></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-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.55.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>
<divclass="item-table"><divclass="item-left module-item"><aclass="struct"href="struct.Autocomplete.html"title="widgetry::Autocomplete struct">Autocomplete</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.ButtonBuilder.html"title="widgetry::ButtonBuilder struct">ButtonBuilder</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.ButtonStyle.html"title="widgetry::ButtonStyle struct">ButtonStyle</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.Cached.html"title="widgetry::Cached struct">Cached</a></div><divclass="item-right docblock-short"><p>Store a cached key/value pair, only recalculating when the key changes.</p>
</div><divclass="item-left module-item"><aclass="struct"href="struct.Canvas.html"title="widgetry::Canvas struct">Canvas</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.CanvasSettings.html"title="widgetry::CanvasSettings struct">CanvasSettings</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.Choice.html"title="widgetry::Choice struct">Choice</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.Color.html"title="widgetry::Color struct">Color</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.CompareTimes.html"title="widgetry::CompareTimes struct">CompareTimes</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.DragDrop.html"title="widgetry::DragDrop struct">DragDrop</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.DrawWithTooltips.html"title="widgetry::DrawWithTooltips struct">DrawWithTooltips</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.Drawable.html"title="widgetry::Drawable struct">Drawable</a></div><divclass="item-right docblock-short"><p>Geometry that’s been uploaded to the GPU once and can be quickly redrawn many times. Create by
</div><divclass="item-left module-item"><aclass="struct"href="struct.EdgeInsets.html"title="widgetry::EdgeInsets struct">EdgeInsets</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.EventCtx.html"title="widgetry::EventCtx struct">EventCtx</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.FanChart.html"title="widgetry::FanChart struct">FanChart</a></div><divclass="item-right docblock-short"></div><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><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><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><divclass="item-left module-item"><aclass="struct"href="struct.ScatterPlot.html"title="widgetry::ScatterPlot struct">ScatterPlot</a></div><divclass="item-right docblock-short"></div><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><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><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><divclass="item-left module-item"><aclass="struct"href="struct.Series.html"title="widgetry::Series struct">Series</a></div><divclass="item-right docblock-short"></div><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><divclass="item-left module-item"><aclass="struct"href="struct.Slider.html"title="widgetry::Slider struct">Slider</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="struct"href="struct.Spinner.html"title="widgetry::Spinner struct">Spinner</a></div><divclass="item-right docblock-short"></div><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-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><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><divclass="item-left module-item"><aclass="enum"href="enum.Key.html"title="widgetry::Key enum">Key</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="enum"href="enum.MultiKey.html"title="widgetry::MultiKey enum">MultiKey</a></div><divclass="item-right docblock-short"></div><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><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><divclass="item-left module-item"><aclass="enum"href="enum.StackAlignment.html"title="widgetry::StackAlignment enum">StackAlignment</a></div><divclass="item-right docblock-short"></div><divclass="item-left module-item"><aclass="enum"href="enum.StackAxis.html"title="widgetry::StackAxis enum">StackAxis</a></div><divclass="item-right docblock-short"></div><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-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><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><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><divclass="item-left module-item"><aclass="trait"href="trait.TextExt.html"title="widgetry::TextExt trait">TextExt</a></div><divclass="item-right docblock-short"></div><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