aboutsummaryrefslogtreecommitdiff
path: root/examples/name.rs
diff options
context:
space:
mode:
authorPolesznyák Márk <contact@pml68.dev>2025-10-20 12:47:36 +0200
committerPolesznyák Márk <contact@pml68.dev>2025-10-20 12:51:08 +0200
commite7509d41405a1f5af64f2f74166f2bc5f1673225 (patch)
treec2e56fb086d83938d4c40238afccc66f925caacb /examples/name.rs
parentfix: markdown `Viewer` impl (diff)
downloadiced_selection-e7509d41405a1f5af64f2f74166f2bc5f1673225.tar.gz
feat: make markdown support optional with a feature flag
Diffstat (limited to 'examples/name.rs')
-rw-r--r--examples/name.rs39
1 files changed, 0 insertions, 39 deletions
diff --git a/examples/name.rs b/examples/name.rs
deleted file mode 100644
index 6d0edec..0000000
--- a/examples/name.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-#![allow(missing_docs)]
-use iced::widget::{center, column, text_input};
-use iced::{Center, Element};
-use iced_selection::text;
-
-fn main() -> iced::Result {
- iced::run(State::update, State::view)
-}
-
-#[derive(Default)]
-struct State {
- name: String,
-}
-
-#[derive(Debug, Clone)]
-enum Message {
- UpdateText(String),
-}
-
-impl State {
- fn update(&mut self, message: Message) {
- match message {
- Message::UpdateText(name) => self.name = name,
- };
- }
-
- fn view(&self) -> Element<'_, Message> {
- center(
- column![
- text!("Hello {}", &self.name),
- text_input("Type your name here...", &self.name)
- .on_input(Message::UpdateText)
- ]
- .spacing(10)
- .align_x(Center),
- )
- .into()
- }
-}