diff options
author | 2019-08-28 06:45:39 +0200 | |
---|---|---|
committer | 2019-08-28 06:45:39 +0200 | |
commit | 8758dd446f25553049b6dd2ab9be0007febb4877 (patch) | |
tree | ab43af4c5ef6027ed5effb44534e4d2429a296fa /src/widget.rs | |
parent | 5dbcf211ef1a157586454bd5316ef3f7f93018c4 (diff) | |
download | iced-8758dd446f25553049b6dd2ab9be0007febb4877.tar.gz iced-8758dd446f25553049b6dd2ab9be0007febb4877.tar.bz2 iced-8758dd446f25553049b6dd2ab9be0007febb4877.zip |
Write more documentation
Diffstat (limited to 'src/widget.rs')
-rw-r--r-- | src/widget.rs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/widget.rs b/src/widget.rs index c3df3bc1..cd3ff7a2 100644 --- a/src/widget.rs +++ b/src/widget.rs @@ -1,8 +1,14 @@ //! Use the built-in widgets or create your own! //! -//! # Customization -//! Every drawable widget has its own module with a `Renderer` trait that must -//! be implemented by a renderer before being able to use it as a [`Widget`]. +//! # Built-in widgets +//! Every built-in drawable widget has its own module with a `Renderer` trait +//! that must be implemented by an [`iced::Renderer`] before being able to use +//! it as a [`Widget`]. +//! +//! # Custom widgets +//! If you want to implement a custom widget, you simply need to implement the +//! [`Widget`] trait. You can use the API of the built-in widgets as a guide or +//! source of inspiration. //! //! # Re-exports //! For convenience, the contents of this module are available at the root @@ -13,6 +19,7 @@ //! ``` //! //! [`Widget`]: trait.Widget.html +//! [`iced::Renderer`]: ../trait.Renderer.html mod column; mod row; @@ -78,8 +85,8 @@ pub trait Widget<Message, Renderer>: std::fmt::Debug { /// its value cannot affect the overall [`Layout`] of the user interface. /// /// [`Widget`]: trait.Widget.html - /// [`Layout`]: struct.Layout.html - /// [`Text`]: ../widget/text/struct.Text.html + /// [`Layout`]: ../struct.Layout.html + /// [`Text`]: text/struct.Text.html fn hash(&self, state: &mut Hasher); /// Processes a runtime [`Event`]. @@ -93,9 +100,9 @@ pub trait Widget<Message, Renderer>: std::fmt::Debug { /// /// By default, it does nothing. /// - /// [`Event`]: enum.Event.html + /// [`Event`]: ../enum.Event.html /// [`Widget`]: trait.Widget.html - /// [`Layout`]: struct.Layout.html + /// [`Layout`]: ../struct.Layout.html fn on_event( &mut self, _event: Event, |