From 1f85e1167c6fc2249647a42ada06ca5e2ba8f94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 2 Apr 2020 02:35:23 +0200 Subject: [PATCH] Add examples to `iced_native::Widget` --- native/src/widget.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/native/src/widget.rs b/native/src/widget.rs index 88f819c9..4453145b 100644 --- a/native/src/widget.rs +++ b/native/src/widget.rs @@ -76,6 +76,24 @@ use crate::{layout, Clipboard, Event, Hasher, Layout, Length, Point}; /// /// [`Widget`]: trait.Widget.html /// [`Element`]: ../struct.Element.html +/// +/// # Examples +/// The repository has some [examples] showcasing how to implement a custom +/// widget: +/// +/// - [`bezier_tool`], a Paint-like tool for drawing Bézier curves using +/// [`lyon`]. +/// - [`custom_widget`], a demonstration of how to build a custom widget that +/// draws a circle. +/// - [`geometry`], a custom widget showcasing how to draw geometry with the +/// `Mesh2D` primitive in [`iced_wgpu`]. +/// +/// [examples]: https://github.com/hecrj/iced/tree/0.1/examples +/// [`bezier_tool`]: https://github.com/hecrj/iced/tree/0.1/examples/bezier_tool +/// [`custom_widget`]: https://github.com/hecrj/iced/tree/0.1/examples/custom_widget +/// [`geometry`]: https://github.com/hecrj/iced/tree/0.1/examples/geometry +/// [`lyon`]: https://github.com/nical/lyon +/// [`iced_wgpu`]: https://github.com/hecrj/iced/tree/0.1/wgpu pub trait Widget where Renderer: crate::Renderer, @@ -139,12 +157,14 @@ where /// * a mutable `Message` list, allowing the [`Widget`] to produce /// new messages based on user interaction. /// * the `Renderer` + /// * a [`Clipboard`], if available /// /// By default, it does nothing. /// /// [`Event`]: ../enum.Event.html /// [`Widget`]: trait.Widget.html /// [`Layout`]: ../layout/struct.Layout.html + /// [`Clipboard`]: ../trait.Clipboard.html fn on_event( &mut self, _event: Event,