summaryrefslogtreecommitdiffstats
path: root/examples/svg
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-08-06 00:32:57 +0200
committerLibravatar GitHub <noreply@github.com>2022-08-06 00:32:57 +0200
commit1923dbf7f0769d55e5283f572fde0ce752e28b86 (patch)
tree7be9b36f941f6e13ddc8884f715c04555b1e77db /examples/svg
parent1b4f38c71f6e05e26599ee75ea9c91dde96e71ae (diff)
parentc23ed7e4a0a2b62a0d7cabe6e35d7323eac543d2 (diff)
downloadiced-1923dbf7f0769d55e5283f572fde0ce752e28b86.tar.gz
iced-1923dbf7f0769d55e5283f572fde0ce752e28b86.tar.bz2
iced-1923dbf7f0769d55e5283f572fde0ce752e28b86.zip
Merge pull request #1393 from iced-rs/deprecate-stateful-widgets
Replace stateful widgets with the new `iced_pure` API
Diffstat (limited to 'examples/svg')
-rw-r--r--examples/svg/src/main.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs
index 8707fa3b..27d175da 100644
--- a/examples/svg/src/main.rs
+++ b/examples/svg/src/main.rs
@@ -1,4 +1,5 @@
-use iced::{Container, Element, Length, Sandbox, Settings, Svg};
+use iced::widget::{container, svg};
+use iced::{Element, Length, Sandbox, Settings};
pub fn main() -> iced::Result {
Tiger::run(Settings::default())
@@ -19,15 +20,15 @@ impl Sandbox for Tiger {
fn update(&mut self, _message: ()) {}
- fn view(&mut self) -> Element<()> {
- let svg = Svg::from_path(format!(
+ fn view(&self) -> Element<()> {
+ let svg = svg(svg::Handle::from_path(format!(
"{}/resources/tiger.svg",
env!("CARGO_MANIFEST_DIR")
- ))
+ )))
.width(Length::Fill)
.height(Length::Fill);
- Container::new(svg)
+ container(svg)
.width(Length::Fill)
.height(Length::Fill)
.padding(20)