1
0
Fork 0

Document create_iced_editor()

This commit is contained in:
Robbert van der Helm 2022-03-13 01:10:45 +01:00
parent 812f6d86f8
commit 43590db8d0

View file

@ -12,17 +12,14 @@ use std::sync::Arc;
/// Re-export for convenience. /// Re-export for convenience.
pub use iced_baseview::*; pub use iced_baseview::*;
/// FIXME: Document how this works once everything actually works. The below comment is from the /// Create an [`Editor`] instance using [iced](https://github.com/iced-rs/iced). The rough idea is
/// egui version. /// that you implement [`IcedEditor`], which is roughly analogous to iced's regular [`Application`]
/// /// trait except that it receives the [`GuiContext`] alongside its initialization flags so it can
/// Create an [`Editor`] instance using an [`iced`][::iced] GUI. Using the user state parameter is /// update the parameter values. The [`IcedState`] passed to this function contains the GUI's
/// optional, but it can be useful for keeping track of some temporary GUI-only settings. See the /// intitial size, and this is kept in sync whenever the GUI gets resized. You can also use this to
/// `gui_gain` example for more information on how to use this. The [`IcedState`] passed to this /// know if the GUI is open, so you can avoid performing potentially expensive calculations while
/// function contains the GUI's intitial size, and this is kept in sync whenever the GUI gets /// the GUI is not open. If you want this size to be persisted when restoring a plugin instance,
/// resized. You can also use this to know if the GUI is open, so you can avoid performing /// then you can store it in a `#[persist = "key"]` field on your parameters struct.
/// potentially expensive calculations while the GUI is not open. If you want this size to be
/// persisted when restoring a plugin instance, then you can store it in a `#[persist = "key"]`
/// field on your parameters struct.
/// ///
/// See [`IcedState::from_size()`]. /// See [`IcedState::from_size()`].
pub fn create_iced_editor<E: IcedEditor>( pub fn create_iced_editor<E: IcedEditor>(