diff options
author | 2024-03-17 14:16:38 +0100 | |
---|---|---|
committer | 2024-03-17 14:19:12 +0100 | |
commit | 54f44754eb216d4b2c08cd2a7c3582f1dc295205 (patch) | |
tree | 9f4a999ad92c62a1cf4df4559ff320fda83577c1 /examples | |
parent | 7e1ef7d150aa3d4d05942eea2706348f20d61d64 (diff) | |
download | iced-54f44754eb216d4b2c08cd2a7c3582f1dc295205.tar.gz iced-54f44754eb216d4b2c08cd2a7c3582f1dc295205.tar.bz2 iced-54f44754eb216d4b2c08cd2a7c3582f1dc295205.zip |
Move `Program` to `application` module
Diffstat (limited to 'examples')
26 files changed, 31 insertions, 43 deletions
diff --git a/examples/arc/src/main.rs b/examples/arc/src/main.rs index b1e8402a..4576404f 100644 --- a/examples/arc/src/main.rs +++ b/examples/arc/src/main.rs @@ -7,7 +7,7 @@ use iced::widget::canvas::{ use iced::{Element, Length, Point, Rectangle, Renderer, Subscription, Theme}; pub fn main() -> iced::Result { - iced::application("Arc - Iced", Arc::update, Arc::view) + iced::program("Arc - Iced", Arc::update, Arc::view) .subscription(Arc::subscription) .theme(|_| Theme::Dark) .antialiasing(true) diff --git a/examples/bezier_tool/src/main.rs b/examples/bezier_tool/src/main.rs index d822c69b..cf70bd40 100644 --- a/examples/bezier_tool/src/main.rs +++ b/examples/bezier_tool/src/main.rs @@ -3,7 +3,7 @@ use iced::widget::{button, column, text}; use iced::{Alignment, Element, Length}; pub fn main() -> iced::Result { - iced::application("Bezier Tool - Iced", Example::update, Example::view) + iced::program("Bezier Tool - Iced", Example::update, Example::view) .antialiasing(true) .run() } diff --git a/examples/checkbox/src/main.rs b/examples/checkbox/src/main.rs index 6a3b9464..38949336 100644 --- a/examples/checkbox/src/main.rs +++ b/examples/checkbox/src/main.rs @@ -4,7 +4,7 @@ use iced::{Element, Font, Length}; const ICON_FONT: Font = Font::with_name("icons"); pub fn main() -> iced::Result { - iced::application("Checkbox - Iced", Example::update, Example::view) + iced::program("Checkbox - Iced", Example::update, Example::view) .font(include_bytes!("../fonts/icons.ttf").as_slice()) .run() } diff --git a/examples/clock/src/main.rs b/examples/clock/src/main.rs index ebb22cef..897f8f1b 100644 --- a/examples/clock/src/main.rs +++ b/examples/clock/src/main.rs @@ -8,7 +8,7 @@ use iced::{ }; pub fn main() -> iced::Result { - iced::application("Clock - Iced", Clock::update, Clock::view) + iced::program("Clock - Iced", Clock::update, Clock::view) .subscription(Clock::subscription) .theme(Clock::theme) .antialiasing(true) diff --git a/examples/color_palette/src/main.rs b/examples/color_palette/src/main.rs index 2cded2db..29337508 100644 --- a/examples/color_palette/src/main.rs +++ b/examples/color_palette/src/main.rs @@ -13,7 +13,7 @@ use std::marker::PhantomData; use std::ops::RangeInclusive; pub fn main() -> iced::Result { - iced::application( + iced::program( "Color Palette - Iced", ColorPalette::update, ColorPalette::view, diff --git a/examples/custom_shader/src/main.rs b/examples/custom_shader/src/main.rs index 4457a15a..aa3dafe9 100644 --- a/examples/custom_shader/src/main.rs +++ b/examples/custom_shader/src/main.rs @@ -9,13 +9,9 @@ use iced::window; use iced::{Alignment, Color, Element, Length, Subscription}; fn main() -> iced::Result { - iced::application( - "Custom Shader - Iced", - IcedCubes::update, - IcedCubes::view, - ) - .subscription(IcedCubes::subscription) - .run() + iced::program("Custom Shader - Iced", IcedCubes::update, IcedCubes::view) + .subscription(IcedCubes::subscription) + .run() } struct IcedCubes { diff --git a/examples/download_progress/src/main.rs b/examples/download_progress/src/main.rs index 8d7994c8..9f4769e0 100644 --- a/examples/download_progress/src/main.rs +++ b/examples/download_progress/src/main.rs @@ -4,13 +4,9 @@ use iced::widget::{button, column, container, progress_bar, text, Column}; use iced::{Alignment, Element, Length, Subscription}; pub fn main() -> iced::Result { - iced::application( - "Download Progress - Iced", - Example::update, - Example::view, - ) - .subscription(Example::subscription) - .run() + iced::program("Download Progress - Iced", Example::update, Example::view) + .subscription(Example::subscription) + .run() } #[derive(Debug)] diff --git a/examples/events/src/main.rs b/examples/events/src/main.rs index e18fe299..bf568c94 100644 --- a/examples/events/src/main.rs +++ b/examples/events/src/main.rs @@ -5,7 +5,7 @@ use iced::window; use iced::{Alignment, Command, Element, Length, Subscription}; pub fn main() -> iced::Result { - iced::application("Events - Iced", Events::update, Events::view) + iced::program("Events - Iced", Events::update, Events::view) .subscription(Events::subscription) .exit_on_close_request(false) .run() diff --git a/examples/exit/src/main.rs b/examples/exit/src/main.rs index 4948bd0f..7bed272d 100644 --- a/examples/exit/src/main.rs +++ b/examples/exit/src/main.rs @@ -3,7 +3,7 @@ use iced::window; use iced::{Alignment, Command, Element, Length}; pub fn main() -> iced::Result { - iced::application("Exit - Iced", Exit::update, Exit::view).run() + iced::program("Exit - Iced", Exit::update, Exit::view).run() } #[derive(Default)] diff --git a/examples/gradient/src/main.rs b/examples/gradient/src/main.rs index 6cfe395a..9c48f4b9 100644 --- a/examples/gradient/src/main.rs +++ b/examples/gradient/src/main.rs @@ -8,7 +8,7 @@ use iced::{Alignment, Color, Element, Length, Radians, Theme}; pub fn main() -> iced::Result { tracing_subscriber::fmt::init(); - iced::application("Gradient - Iced", Gradient::update, Gradient::view) + iced::program("Gradient - Iced", Gradient::update, Gradient::view) .style(Gradient::style) .transparent(true) .run() diff --git a/examples/layout/src/main.rs b/examples/layout/src/main.rs index e6b521b2..713e2b70 100644 --- a/examples/layout/src/main.rs +++ b/examples/layout/src/main.rs @@ -10,7 +10,7 @@ use iced::{ }; pub fn main() -> iced::Result { - iced::application(Layout::title, Layout::update, Layout::view) + iced::program(Layout::title, Layout::update, Layout::view) .subscription(Layout::subscription) .theme(Layout::theme) .run() diff --git a/examples/loading_spinners/src/main.rs b/examples/loading_spinners/src/main.rs index 3261bdcd..eaa4d57e 100644 --- a/examples/loading_spinners/src/main.rs +++ b/examples/loading_spinners/src/main.rs @@ -11,7 +11,7 @@ use circular::Circular; use linear::Linear; pub fn main() -> iced::Result { - iced::application( + iced::program( "Loading Spinners - Iced", LoadingSpinners::update, LoadingSpinners::view, diff --git a/examples/multitouch/src/main.rs b/examples/multitouch/src/main.rs index 69717310..2453c7f5 100644 --- a/examples/multitouch/src/main.rs +++ b/examples/multitouch/src/main.rs @@ -13,7 +13,7 @@ use std::collections::HashMap; pub fn main() -> iced::Result { tracing_subscriber::fmt::init(); - iced::application("Multitouch - Iced", Multitouch::update, Multitouch::view) + iced::program("Multitouch - Iced", Multitouch::update, Multitouch::view) .antialiasing(true) .centered() .run() diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 439e9ee5..829996d8 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -7,7 +7,7 @@ use iced::widget::{ use iced::{Color, Element, Length, Size, Subscription}; pub fn main() -> iced::Result { - iced::application("Pane Grid - Iced", Example::update, Example::view) + iced::program("Pane Grid - Iced", Example::update, Example::view) .subscription(Example::subscription) .run() } diff --git a/examples/pokedex/src/main.rs b/examples/pokedex/src/main.rs index c737b87e..0811c08d 100644 --- a/examples/pokedex/src/main.rs +++ b/examples/pokedex/src/main.rs @@ -3,7 +3,7 @@ use iced::widget::{self, column, container, image, row, text}; use iced::{Alignment, Command, Element, Length}; pub fn main() -> iced::Result { - iced::application(Pokedex::title, Pokedex::update, Pokedex::view) + iced::program(Pokedex::title, Pokedex::update, Pokedex::view) .load(Pokedex::search) .run() } diff --git a/examples/qr_code/src/main.rs b/examples/qr_code/src/main.rs index 1a23331d..b93adf04 100644 --- a/examples/qr_code/src/main.rs +++ b/examples/qr_code/src/main.rs @@ -4,7 +4,7 @@ use iced::widget::{ use iced::{Alignment, Element, Length, Theme}; pub fn main() -> iced::Result { - iced::application( + iced::program( "QR Code Generator - Iced", QRGenerator::update, QRGenerator::view, diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs index 296a7f54..d887c41b 100644 --- a/examples/screenshot/src/main.rs +++ b/examples/screenshot/src/main.rs @@ -13,7 +13,7 @@ use ::image::ColorType; fn main() -> iced::Result { tracing_subscriber::fmt::init(); - iced::application("Screenshot - Iced", Example::update, Example::view) + iced::program("Screenshot - Iced", Example::update, Example::view) .subscription(Example::subscription) .run() } diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index a6f3c689..240ae908 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -10,7 +10,7 @@ use once_cell::sync::Lazy; static SCROLLABLE_ID: Lazy<scrollable::Id> = Lazy::new(scrollable::Id::unique); pub fn main() -> iced::Result { - iced::application( + iced::program( "Scrollable - Iced", ScrollableDemo::update, ScrollableDemo::view, diff --git a/examples/sierpinski_triangle/src/main.rs b/examples/sierpinski_triangle/src/main.rs index c7287516..07ae05d6 100644 --- a/examples/sierpinski_triangle/src/main.rs +++ b/examples/sierpinski_triangle/src/main.rs @@ -8,7 +8,7 @@ use rand::Rng; use std::fmt::Debug; fn main() -> iced::Result { - iced::application( + iced::program( "Sierpinski Triangle - Iced", SierpinskiEmulator::update, SierpinskiEmulator::view, diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 40fd6b12..b5228f09 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -22,7 +22,7 @@ use std::time::Instant; pub fn main() -> iced::Result { tracing_subscriber::fmt::init(); - iced::application( + iced::program( "Solar System - Iced", SolarSystem::update, SolarSystem::view, diff --git a/examples/stopwatch/src/main.rs b/examples/stopwatch/src/main.rs index 2496b85b..b9eb19cf 100644 --- a/examples/stopwatch/src/main.rs +++ b/examples/stopwatch/src/main.rs @@ -7,7 +7,7 @@ use iced::{Alignment, Element, Length, Subscription, Theme}; use std::time::{Duration, Instant}; pub fn main() -> iced::Result { - iced::application("Stopwatch - Iced", Stopwatch::update, Stopwatch::view) + iced::program("Stopwatch - Iced", Stopwatch::update, Stopwatch::view) .subscription(Stopwatch::subscription) .theme(Stopwatch::theme) .run() diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index ce14aacb..73268da0 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -6,7 +6,7 @@ use iced::widget::{ use iced::{Alignment, Element, Length, Theme}; pub fn main() -> iced::Result { - iced::application("Styling - Iced", Styling::update, Styling::view) + iced::program("Styling - Iced", Styling::update, Styling::view) .theme(Styling::theme) .run() } diff --git a/examples/system_information/src/main.rs b/examples/system_information/src/main.rs index 75a4d8d6..a6ac27a6 100644 --- a/examples/system_information/src/main.rs +++ b/examples/system_information/src/main.rs @@ -2,12 +2,8 @@ use iced::widget::{button, column, container, text}; use iced::{system, Command, Element, Length}; pub fn main() -> iced::Result { - iced::application( - "System Information - Iced", - Example::update, - Example::view, - ) - .run() + iced::program("System Information - Iced", Example::update, Example::view) + .run() } #[derive(Default)] diff --git a/examples/tour/src/main.rs b/examples/tour/src/main.rs index 97ce761c..be6e24d5 100644 --- a/examples/tour/src/main.rs +++ b/examples/tour/src/main.rs @@ -16,7 +16,7 @@ pub fn main() -> iced::Result { #[cfg(not(target_arch = "wasm32"))] tracing_subscriber::fmt::init(); - iced::application(Tour::title, Tour::update, Tour::view) + iced::program(Tour::title, Tour::update, Tour::view) .centered() .run() } diff --git a/examples/url_handler/src/main.rs b/examples/url_handler/src/main.rs index 540d927e..df705b6c 100644 --- a/examples/url_handler/src/main.rs +++ b/examples/url_handler/src/main.rs @@ -3,7 +3,7 @@ use iced::widget::{container, text}; use iced::{Element, Length, Subscription}; pub fn main() -> iced::Result { - iced::application("URL Handler - Iced", App::update, App::view) + iced::program("URL Handler - Iced", App::update, App::view) .subscription(App::subscription) .run() } diff --git a/examples/vectorial_text/src/main.rs b/examples/vectorial_text/src/main.rs index 7b7814ae..a7391e23 100644 --- a/examples/vectorial_text/src/main.rs +++ b/examples/vectorial_text/src/main.rs @@ -6,7 +6,7 @@ use iced::widget::{ use iced::{Element, Length, Point, Rectangle, Renderer, Theme, Vector}; pub fn main() -> iced::Result { - iced::application( + iced::program( "Vectorial Text - Iced", VectorialText::update, VectorialText::view, |