From 3d7d6b725e4107d355f0c7dd4c6dc82dd7d01cba Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Tue, 28 May 2024 13:25:31 -0400 Subject: [PATCH] Move back examples to its previous location --- Readme.md | 14 +++++++------- cursive/examples | 1 - {examples => cursive/examples}/Readme.md | 0 .../examples}/advanced_user_data.rs | 0 {examples => cursive/examples}/ansi.rs | 0 {examples => cursive/examples}/assets/cities.txt | 0 {examples => cursive/examples}/assets/lorem.txt | 0 {examples => cursive/examples}/assets/style.toml | 0 {examples => cursive/examples}/autocomplete.rs | 0 {examples => cursive/examples}/builder.rs | 0 {examples => cursive/examples}/builder.yaml | 0 {examples => cursive/examples}/colors.rs | 0 {examples => cursive/examples}/ctrl_c.rs | 0 {examples => cursive/examples}/debug_console.rs | 0 {examples => cursive/examples}/dialog.rs | 0 {examples => cursive/examples}/edit.rs | 0 {examples => cursive/examples}/fixed_layout.rs | 0 {examples => cursive/examples}/focus.rs | 0 {examples => cursive/examples}/hello_world.rs | 0 cursive/examples/issue_768.rs | 15 +++++++++++++++ {examples => cursive/examples}/key_codes.rs | 0 {examples => cursive/examples}/label-view.yaml | 0 {examples => cursive/examples}/linear.rs | 0 {examples => cursive/examples}/list_view.rs | 0 {examples => cursive/examples}/logs.rs | 0 {examples => cursive/examples}/lorem.rs | 0 {examples => cursive/examples}/markup.rs | 0 {examples => cursive/examples}/menubar.rs | 0 {examples => cursive/examples}/mines/Readme.md | 0 {examples => cursive/examples}/mines/game.rs | 0 {examples => cursive/examples}/mines/main.rs | 0 {examples => cursive/examples}/mutation.rs | 0 {examples => cursive/examples}/panels.rs | 0 {examples => cursive/examples}/pause.rs | 0 {examples => cursive/examples}/position.rs | 0 {examples => cursive/examples}/progress.rs | 0 {examples => cursive/examples}/radio.rs | 0 {examples => cursive/examples}/refcell_view.rs | 0 {examples => cursive/examples}/scroll.rs | 0 {examples => cursive/examples}/select.rs | 0 {examples => cursive/examples}/select_test.rs | 0 {examples => cursive/examples}/slider.rs | 0 {examples => cursive/examples}/status.rs | 0 {examples => cursive/examples}/status_bar_ext.rs | 0 {examples => cursive/examples}/stopwatch.rs | 0 {examples => cursive/examples}/tcp_server.rs | 0 .../examples}/terminal_default.rs | 0 {examples => cursive/examples}/text_area.rs | 0 .../examples}/text_with_ansi_codes.txt | 0 {examples => cursive/examples}/theme.rs | 0 {examples => cursive/examples}/theme_editor.rs | 0 {examples => cursive/examples}/theme_manual.rs | 0 {examples => cursive/examples}/themed_view.rs | 0 {examples => cursive/examples}/user_data.rs | 0 {examples => cursive/examples}/view.yaml | 0 {examples => cursive/examples}/vpv.rs | 0 {examples => cursive/examples}/vspace.yaml | 0 {examples => cursive/examples}/window_title.rs | 0 examples | 1 + 59 files changed, 23 insertions(+), 8 deletions(-) delete mode 120000 cursive/examples rename {examples => cursive/examples}/Readme.md (100%) rename {examples => cursive/examples}/advanced_user_data.rs (100%) rename {examples => cursive/examples}/ansi.rs (100%) rename {examples => cursive/examples}/assets/cities.txt (100%) rename {examples => cursive/examples}/assets/lorem.txt (100%) rename {examples => cursive/examples}/assets/style.toml (100%) rename {examples => cursive/examples}/autocomplete.rs (100%) rename {examples => cursive/examples}/builder.rs (100%) rename {examples => cursive/examples}/builder.yaml (100%) rename {examples => cursive/examples}/colors.rs (100%) rename {examples => cursive/examples}/ctrl_c.rs (100%) rename {examples => cursive/examples}/debug_console.rs (100%) rename {examples => cursive/examples}/dialog.rs (100%) rename {examples => cursive/examples}/edit.rs (100%) rename {examples => cursive/examples}/fixed_layout.rs (100%) rename {examples => cursive/examples}/focus.rs (100%) rename {examples => cursive/examples}/hello_world.rs (100%) create mode 100644 cursive/examples/issue_768.rs rename {examples => cursive/examples}/key_codes.rs (100%) rename {examples => cursive/examples}/label-view.yaml (100%) rename {examples => cursive/examples}/linear.rs (100%) rename {examples => cursive/examples}/list_view.rs (100%) rename {examples => cursive/examples}/logs.rs (100%) rename {examples => cursive/examples}/lorem.rs (100%) rename {examples => cursive/examples}/markup.rs (100%) rename {examples => cursive/examples}/menubar.rs (100%) rename {examples => cursive/examples}/mines/Readme.md (100%) rename {examples => cursive/examples}/mines/game.rs (100%) rename {examples => cursive/examples}/mines/main.rs (100%) rename {examples => cursive/examples}/mutation.rs (100%) rename {examples => cursive/examples}/panels.rs (100%) rename {examples => cursive/examples}/pause.rs (100%) rename {examples => cursive/examples}/position.rs (100%) rename {examples => cursive/examples}/progress.rs (100%) rename {examples => cursive/examples}/radio.rs (100%) rename {examples => cursive/examples}/refcell_view.rs (100%) rename {examples => cursive/examples}/scroll.rs (100%) rename {examples => cursive/examples}/select.rs (100%) rename {examples => cursive/examples}/select_test.rs (100%) rename {examples => cursive/examples}/slider.rs (100%) rename {examples => cursive/examples}/status.rs (100%) rename {examples => cursive/examples}/status_bar_ext.rs (100%) rename {examples => cursive/examples}/stopwatch.rs (100%) rename {examples => cursive/examples}/tcp_server.rs (100%) rename {examples => cursive/examples}/terminal_default.rs (100%) rename {examples => cursive/examples}/text_area.rs (100%) rename {examples => cursive/examples}/text_with_ansi_codes.txt (100%) rename {examples => cursive/examples}/theme.rs (100%) rename {examples => cursive/examples}/theme_editor.rs (100%) rename {examples => cursive/examples}/theme_manual.rs (100%) rename {examples => cursive/examples}/themed_view.rs (100%) rename {examples => cursive/examples}/user_data.rs (100%) rename {examples => cursive/examples}/view.yaml (100%) rename {examples => cursive/examples}/vpv.rs (100%) rename {examples => cursive/examples}/vspace.yaml (100%) rename {examples => cursive/examples}/window_title.rs (100%) create mode 120000 examples diff --git a/Readme.md b/Readme.md index 047d2f65d..17d7953da 100644 --- a/Readme.md +++ b/Readme.md @@ -45,16 +45,16 @@ fn main() { } ``` -[![Cursive dialog example](https://raw.githubusercontent.com/gyscos/cursive/main/doc/cursive_example.png)](examples/dialog.rs) +[![Cursive dialog example](https://raw.githubusercontent.com/gyscos/cursive/main/doc/cursive_example.png)](https://github.com/gyscos/cursive/tree/main/cursive/examples/dialog.rs) -Check out the other [examples](https://github.com/gyscos/cursive/tree/main/examples) to get these results, and more: +Check out the other [examples](https://github.com/gyscos/cursive/tree/main/cursive/examples) to get these results, and more:
-lorem.rs example -menubar.rs example -select.rs example -mines example -theme_manual.rs example +lorem.rs example +menubar.rs example +select.rs example +mines example +theme_manual.rs example syntect example
diff --git a/cursive/examples b/cursive/examples deleted file mode 120000 index a6573af9c..000000000 --- a/cursive/examples +++ /dev/null @@ -1 +0,0 @@ -../examples \ No newline at end of file diff --git a/examples/Readme.md b/cursive/examples/Readme.md similarity index 100% rename from examples/Readme.md rename to cursive/examples/Readme.md diff --git a/examples/advanced_user_data.rs b/cursive/examples/advanced_user_data.rs similarity index 100% rename from examples/advanced_user_data.rs rename to cursive/examples/advanced_user_data.rs diff --git a/examples/ansi.rs b/cursive/examples/ansi.rs similarity index 100% rename from examples/ansi.rs rename to cursive/examples/ansi.rs diff --git a/examples/assets/cities.txt b/cursive/examples/assets/cities.txt similarity index 100% rename from examples/assets/cities.txt rename to cursive/examples/assets/cities.txt diff --git a/examples/assets/lorem.txt b/cursive/examples/assets/lorem.txt similarity index 100% rename from examples/assets/lorem.txt rename to cursive/examples/assets/lorem.txt diff --git a/examples/assets/style.toml b/cursive/examples/assets/style.toml similarity index 100% rename from examples/assets/style.toml rename to cursive/examples/assets/style.toml diff --git a/examples/autocomplete.rs b/cursive/examples/autocomplete.rs similarity index 100% rename from examples/autocomplete.rs rename to cursive/examples/autocomplete.rs diff --git a/examples/builder.rs b/cursive/examples/builder.rs similarity index 100% rename from examples/builder.rs rename to cursive/examples/builder.rs diff --git a/examples/builder.yaml b/cursive/examples/builder.yaml similarity index 100% rename from examples/builder.yaml rename to cursive/examples/builder.yaml diff --git a/examples/colors.rs b/cursive/examples/colors.rs similarity index 100% rename from examples/colors.rs rename to cursive/examples/colors.rs diff --git a/examples/ctrl_c.rs b/cursive/examples/ctrl_c.rs similarity index 100% rename from examples/ctrl_c.rs rename to cursive/examples/ctrl_c.rs diff --git a/examples/debug_console.rs b/cursive/examples/debug_console.rs similarity index 100% rename from examples/debug_console.rs rename to cursive/examples/debug_console.rs diff --git a/examples/dialog.rs b/cursive/examples/dialog.rs similarity index 100% rename from examples/dialog.rs rename to cursive/examples/dialog.rs diff --git a/examples/edit.rs b/cursive/examples/edit.rs similarity index 100% rename from examples/edit.rs rename to cursive/examples/edit.rs diff --git a/examples/fixed_layout.rs b/cursive/examples/fixed_layout.rs similarity index 100% rename from examples/fixed_layout.rs rename to cursive/examples/fixed_layout.rs diff --git a/examples/focus.rs b/cursive/examples/focus.rs similarity index 100% rename from examples/focus.rs rename to cursive/examples/focus.rs diff --git a/examples/hello_world.rs b/cursive/examples/hello_world.rs similarity index 100% rename from examples/hello_world.rs rename to cursive/examples/hello_world.rs diff --git a/cursive/examples/issue_768.rs b/cursive/examples/issue_768.rs new file mode 100644 index 000000000..0dbdbfda1 --- /dev/null +++ b/cursive/examples/issue_768.rs @@ -0,0 +1,15 @@ +use cursive; + +fn main() { + let mut v = cursive::views::SelectView::new() + .item_str("Foo") + .item_str("Bar"); + + let (label, content) = v.get_item_mut(1).unwrap(); + *label = "foo".into(); + *content = "foooo".into(); + + let mut siv = cursive::default(); + siv.add_layer(v); + siv.run(); +} diff --git a/examples/key_codes.rs b/cursive/examples/key_codes.rs similarity index 100% rename from examples/key_codes.rs rename to cursive/examples/key_codes.rs diff --git a/examples/label-view.yaml b/cursive/examples/label-view.yaml similarity index 100% rename from examples/label-view.yaml rename to cursive/examples/label-view.yaml diff --git a/examples/linear.rs b/cursive/examples/linear.rs similarity index 100% rename from examples/linear.rs rename to cursive/examples/linear.rs diff --git a/examples/list_view.rs b/cursive/examples/list_view.rs similarity index 100% rename from examples/list_view.rs rename to cursive/examples/list_view.rs diff --git a/examples/logs.rs b/cursive/examples/logs.rs similarity index 100% rename from examples/logs.rs rename to cursive/examples/logs.rs diff --git a/examples/lorem.rs b/cursive/examples/lorem.rs similarity index 100% rename from examples/lorem.rs rename to cursive/examples/lorem.rs diff --git a/examples/markup.rs b/cursive/examples/markup.rs similarity index 100% rename from examples/markup.rs rename to cursive/examples/markup.rs diff --git a/examples/menubar.rs b/cursive/examples/menubar.rs similarity index 100% rename from examples/menubar.rs rename to cursive/examples/menubar.rs diff --git a/examples/mines/Readme.md b/cursive/examples/mines/Readme.md similarity index 100% rename from examples/mines/Readme.md rename to cursive/examples/mines/Readme.md diff --git a/examples/mines/game.rs b/cursive/examples/mines/game.rs similarity index 100% rename from examples/mines/game.rs rename to cursive/examples/mines/game.rs diff --git a/examples/mines/main.rs b/cursive/examples/mines/main.rs similarity index 100% rename from examples/mines/main.rs rename to cursive/examples/mines/main.rs diff --git a/examples/mutation.rs b/cursive/examples/mutation.rs similarity index 100% rename from examples/mutation.rs rename to cursive/examples/mutation.rs diff --git a/examples/panels.rs b/cursive/examples/panels.rs similarity index 100% rename from examples/panels.rs rename to cursive/examples/panels.rs diff --git a/examples/pause.rs b/cursive/examples/pause.rs similarity index 100% rename from examples/pause.rs rename to cursive/examples/pause.rs diff --git a/examples/position.rs b/cursive/examples/position.rs similarity index 100% rename from examples/position.rs rename to cursive/examples/position.rs diff --git a/examples/progress.rs b/cursive/examples/progress.rs similarity index 100% rename from examples/progress.rs rename to cursive/examples/progress.rs diff --git a/examples/radio.rs b/cursive/examples/radio.rs similarity index 100% rename from examples/radio.rs rename to cursive/examples/radio.rs diff --git a/examples/refcell_view.rs b/cursive/examples/refcell_view.rs similarity index 100% rename from examples/refcell_view.rs rename to cursive/examples/refcell_view.rs diff --git a/examples/scroll.rs b/cursive/examples/scroll.rs similarity index 100% rename from examples/scroll.rs rename to cursive/examples/scroll.rs diff --git a/examples/select.rs b/cursive/examples/select.rs similarity index 100% rename from examples/select.rs rename to cursive/examples/select.rs diff --git a/examples/select_test.rs b/cursive/examples/select_test.rs similarity index 100% rename from examples/select_test.rs rename to cursive/examples/select_test.rs diff --git a/examples/slider.rs b/cursive/examples/slider.rs similarity index 100% rename from examples/slider.rs rename to cursive/examples/slider.rs diff --git a/examples/status.rs b/cursive/examples/status.rs similarity index 100% rename from examples/status.rs rename to cursive/examples/status.rs diff --git a/examples/status_bar_ext.rs b/cursive/examples/status_bar_ext.rs similarity index 100% rename from examples/status_bar_ext.rs rename to cursive/examples/status_bar_ext.rs diff --git a/examples/stopwatch.rs b/cursive/examples/stopwatch.rs similarity index 100% rename from examples/stopwatch.rs rename to cursive/examples/stopwatch.rs diff --git a/examples/tcp_server.rs b/cursive/examples/tcp_server.rs similarity index 100% rename from examples/tcp_server.rs rename to cursive/examples/tcp_server.rs diff --git a/examples/terminal_default.rs b/cursive/examples/terminal_default.rs similarity index 100% rename from examples/terminal_default.rs rename to cursive/examples/terminal_default.rs diff --git a/examples/text_area.rs b/cursive/examples/text_area.rs similarity index 100% rename from examples/text_area.rs rename to cursive/examples/text_area.rs diff --git a/examples/text_with_ansi_codes.txt b/cursive/examples/text_with_ansi_codes.txt similarity index 100% rename from examples/text_with_ansi_codes.txt rename to cursive/examples/text_with_ansi_codes.txt diff --git a/examples/theme.rs b/cursive/examples/theme.rs similarity index 100% rename from examples/theme.rs rename to cursive/examples/theme.rs diff --git a/examples/theme_editor.rs b/cursive/examples/theme_editor.rs similarity index 100% rename from examples/theme_editor.rs rename to cursive/examples/theme_editor.rs diff --git a/examples/theme_manual.rs b/cursive/examples/theme_manual.rs similarity index 100% rename from examples/theme_manual.rs rename to cursive/examples/theme_manual.rs diff --git a/examples/themed_view.rs b/cursive/examples/themed_view.rs similarity index 100% rename from examples/themed_view.rs rename to cursive/examples/themed_view.rs diff --git a/examples/user_data.rs b/cursive/examples/user_data.rs similarity index 100% rename from examples/user_data.rs rename to cursive/examples/user_data.rs diff --git a/examples/view.yaml b/cursive/examples/view.yaml similarity index 100% rename from examples/view.yaml rename to cursive/examples/view.yaml diff --git a/examples/vpv.rs b/cursive/examples/vpv.rs similarity index 100% rename from examples/vpv.rs rename to cursive/examples/vpv.rs diff --git a/examples/vspace.yaml b/cursive/examples/vspace.yaml similarity index 100% rename from examples/vspace.yaml rename to cursive/examples/vspace.yaml diff --git a/examples/window_title.rs b/cursive/examples/window_title.rs similarity index 100% rename from examples/window_title.rs rename to cursive/examples/window_title.rs diff --git a/examples b/examples new file mode 120000 index 000000000..4fa5748ce --- /dev/null +++ b/examples @@ -0,0 +1 @@ +cursive/examples \ No newline at end of file