Тёмный

Building a simple text editor with iced, a cross-platform GUI library for Rust 

iced-rs
Подписаться 1,1 тыс.
Просмотров 46 тыс.
50% 1

Learn the basics of iced-a cross-platform GUI library for Rust-and build a cool, simple text editor in the process!
00:00:00 Introduction
00:02:04 Initial setup
00:03:59 Hello, iced!
00:11:00 Multi-line text input
00:15:53 The debug view
00:17:46 Dark theme and cursor indicator
00:21:14 Async file loading
00:31:07 Native file picker
00:38:04 File path tracking
00:42:46 New and save interactions
00:53:26 Font loading and custom icons
01:02:22 Tooltips and styling
01:05:01 Syntax highlighting
01:09:12 Theme picker
01:12:55 Subscriptions and save hotkey

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 105   
@4strodev
@4strodev 8 месяцев назад
Man, if the docs have at least a little amount of content, this framework will become super popular
@Notoriousjunior374
@Notoriousjunior374 7 месяцев назад
There are plenty of examples though and there are docs. The docs are just not beginners friendly, so stop being beginners.
@4strodev
@4strodev 7 месяцев назад
@@Notoriousjunior374 Sorry I forgot to take the pill to be a senior rust developer...
@norliegh
@norliegh 7 месяцев назад
​​​​@@Notoriousjunior374 thanks for reminding me that i'm inferior
@foofighterdaz
@foofighterdaz 7 месяцев назад
@@Notoriousjunior374 Ohh, just "git gud"
@timoxx8543
@timoxx8543 6 месяцев назад
agree
@skytech2501
@skytech2501 9 месяцев назад
I am already hooked. I love that it has "Update" and "View" as separate methods, creating excellent isolation of mutable & immutable blocks. modern frameworks combine them making it more complicated.
@program7592
@program7592 16 дней назад
I root for the success of iced so much, IMO it has the best development ergonomics in the entire rust GUI ecosytem. Thanks for the video and for all the hardwork!
@yournamehasbeentaken9752
@yournamehasbeentaken9752 8 месяцев назад
This was perfect thank you! I'm new to rust and was interested in building an editor as way to learn. I hope you do more. Also love Iced so far!
@pyroraptor07
@pyroraptor07 9 месяцев назад
This is a really good tutorial of Iced! Thanks for doing this!
@kommentlezz
@kommentlezz 9 месяцев назад
The most informative introduction of any framework! Good luck with the project!🤩
@iced-rs
@iced-rs 8 месяцев назад
And the most complete one!
@kommentlezz
@kommentlezz 8 месяцев назад
@@iced-rs Yes! It feels like I've learned much more than just the framework because you perfectly showed a really useful example!
@mariinkys
@mariinkys 6 месяцев назад
Thank you so much for this video, I'm just starting with Rust, app development and Iced all at once and this video has been definitely very helpful! Hopefully more to come!
@krabat6117
@krabat6117 4 месяца назад
Awesome, will be using your framework from now on. Looking forward to it! :)
@redhawk3385
@redhawk3385 9 месяцев назад
Can't wait for 0.12 to come out, these new features are really useful
@mrmaymanalt
@mrmaymanalt 3 месяца назад
I just wanna say, excellent tutorial! Everything was very clear and easy to understand, and I made my first iced app with this. Thanks for the hard work!
@auralluring
@auralluring Месяц назад
this might very well be the most useful video i've ever watched. definitely a great way to spend an hour and a half
@jamesb1559
@jamesb1559 Месяц назад
I have been using Egui and Slint UI tools for Rust, and have long looked at iced. This video makes a strong case for switching !
@starlordcodes
@starlordcodes 7 месяцев назад
Really had fun learning with your video, with the amount of things I have learned, I am going to try to make something myself. Looking forward to more such tutorials
@el_carbonara
@el_carbonara 8 месяцев назад
love the tutorial. just the level of detail I need to get started
@tracer4278
@tracer4278 5 месяцев назад
Please make documentation, we are all very much waiting, and it would be very cool if once a week would be released some tutorial on the example of a small project, thank you very much!👍👍👍
@cazdotsys
@cazdotsys 9 месяцев назад
Absolutely love this!
@indierusty
@indierusty 9 месяцев назад
This is incredible. Im beginner learning rust after C and Raylib and Iced looks great but couldn't find any tutorial.
@brucebotes9075
@brucebotes9075 5 месяцев назад
Thank you for this great demo!
@undefined_x00
@undefined_x00 6 месяцев назад
Amazing work!
@thebashpotato
@thebashpotato 4 месяца назад
I've devoted about a year to egui, and at work we use Tauri for alot our applications (mostly because we wanted to reuse React code). But damn, Iced is clean, if that documentation was even somewhat existent, this would absolutely take off.
@yds6268
@yds6268 8 месяцев назад
Didn't even know you guys had a channel, nice
@swez4587
@swez4587 6 месяцев назад
Fantastic tutorial! I learned a lot. Thanks!
@hagimo_dev
@hagimo_dev 9 месяцев назад
Thank you for the awesome work 🙏
8 месяцев назад
Thanks for this!
@henrispriet9812
@henrispriet9812 Месяц назад
You make it look so easy
@echoptic775
@echoptic775 7 месяцев назад
Hector and ice goes well together
@workflowinmind
@workflowinmind 5 месяцев назад
I'm hooked!
@xbz24
@xbz24 8 месяцев назад
thank you hector
@avsaase
@avsaase 9 месяцев назад
This is great! More video like this would be very welcome. If I may suggest a topic, advanced use of subscriptions would be good to have more material on.
@Dworv
@Dworv 6 месяцев назад
seconding this
@hanamjaa
@hanamjaa 7 месяцев назад
I LOVE IT
@FabianVilersBe
@FabianVilersBe 5 месяцев назад
Great content and very didactic to help me chose iced over egui.
@steamedeggeggegg
@steamedeggeggegg 8 месяцев назад
Hope that the text editor widget can be launched on stablized versions
@joshuajones2643
@joshuajones2643 7 месяцев назад
What are some good resources i could look into for using WASM to get this to run online? I'm trying to make a little editor for my org files
@smashedpotato278
@smashedpotato278 12 дней назад
Great Video!! Thanks for the tutorial it really helped. Is there any way to add highlighter for a custom language or custom syntax highlighting? If you could share any resource on this- that would be really helpful.
@letronix6243
@letronix6243 8 месяцев назад
I love you.
@th3oth3rjak3_
@th3oth3rjak3_ 8 месяцев назад
This is an awesome video and I'm really excited about using Iced in some personal projects. I noticed that the editor doesn't respond to the tab keypress to indent in the editor. I went poking around a little bit to see if I could figure out why not, but got a little lost inside source. Any insights on the tab key? One minor comment for future videos,, you type quite fast and slowing down just a little bit would help those coding along so we don't have to keep pausing the video. :)
@iced-rs
@iced-rs 8 месяцев назад
This would need to be implemented by the user, since this use case is specific to code editing and the text editor widget is meant to be relatively use-case agnostic.
@th3oth3rjak3_
@th3oth3rjak3_ 8 месяцев назад
@@iced-rs That makes sense, thanks!
@shastri3303
@shastri3303 14 дней назад
The theme part is a bit tricky. I completely relied on the video for that. It would be better if you could provide some documentation for it.
@akza0729
@akza0729 6 месяцев назад
If suppose someone made notes while learning and shared. Would that help later on with docs? Just asking.
@PragandSens
@PragandSens 8 месяцев назад
ahhh yes, the most complete ui-framework
@DylanMatthewTurner
@DylanMatthewTurner 2 месяца назад
How could I implement line numbering? I've tried a few things, but the issue is I can't clone/modify a Content arbitrarily or track things like scroll effectively. It also doesn't seem like it's possible built-in. I tried cloning iced and modifying the editor to add a ".numbered()" function, but even then I couldn't figure it out as the rendering code was too complicated for me to understand.
@Kfoo-dj4md
@Kfoo-dj4md 8 месяцев назад
Nice video! How did you get a terminal inside helix btw :)
@iced-rs
@iced-rs 8 месяцев назад
It's a floating pane of my terminal multiplexer, Zellij: zellij.dev/ Also built with Rust!
@Kfoo-dj4md
@Kfoo-dj4md 8 месяцев назад
@@iced-rs :0 thank you!
@pijusmagnificus6382
@pijusmagnificus6382 8 месяцев назад
Hi! Great video. How do you execute cargo run? How do you configure Zellij?
@iced-rs
@iced-rs 8 месяцев назад
This is my Zellij layout for working on Rust projects: gist.github.com/hecrj/cf1a60529afd070b6de993fa5d76b9fc
@pijusmagnificus6382
@pijusmagnificus6382 8 месяцев назад
@@iced-rs Thanks
@EDToasty
@EDToasty 7 месяцев назад
How did you have a pop up terminal at 3:30? Is that through helix or zellij?
@qtfimik42
@qtfimik42 5 месяцев назад
i wondered the same... i think it's via zellij: ctrl+p w
@sanjeevshrestha5049
@sanjeevshrestha5049 4 месяца назад
@@qtfimik42ctrl+shift+c, You can set default terminal from settings
@fabiozucconi7068
@fabiozucconi7068 3 месяца назад
the debug feature prints number all over the window... is there a bug? Love you work!
@VBB9999
@VBB9999 Месяц назад
does this toolkit have UI files? like .ui in GTK or .axaml in Avalonia?
@DiscoveringComputers
@DiscoveringComputers 6 месяцев назад
Please make more tutorials
@TheD3adlysin
@TheD3adlysin 6 месяцев назад
Alright fellas load_file keeps throwing this error "functions in traits cannot be declared `async`" anyone seen a resolution for this problem?
@parallelno
@parallelno 4 месяца назад
Does it support docking?
@user-bm6mo3xo4i
@user-bm6mo3xo4i 9 месяцев назад
im having problems in the display of the font icons, for some reason it shows a rectangular icon instead of the one that should be placed. i downloaded the font placing the one i choose and placed the ttf file in the fonts folder, but still i get no icon. any ideas?
@iced-rs
@iced-rs 9 месяцев назад
Make sure you are using the name you chose before downloading the font everywhere! Also, double-check the codepoints; they may be different for you.
@user-bm6mo3xo4i
@user-bm6mo3xo4i 9 месяцев назад
@@iced-rs i fixed it by replacing a letter code of the utf with the icon code in the website
@swordelf4689
@swordelf4689 2 месяца назад
Great video! I'm in love with this font, what's its name?
@iced-rs
@iced-rs 2 месяца назад
The one I use in my terminal is called Hasklig, although I use the Nerd Font variant: Hasklug Nerd Font.
@niamotullah99
@niamotullah99 4 месяца назад
I'm tryna learn this as beginner. But docs aren't ready. I'm just looking at the examples and here and there. Which works kinda but slow. Docs with some projects around would be great
@iced-rs
@iced-rs 4 месяца назад
Indeed. The project isn't ready for beginners yet! Docs (and more) are coming.
@Vancha112
@Vancha112 2 месяца назад
Hows the progress coming along? :)
@frostedson9317
@frostedson9317 4 месяца назад
WE RECIEVE IT fOR UGANDA TOO
@hawke1133
@hawke1133 6 месяцев назад
Question. Where did the "text_editor" vanish too? Checked the crate code and it is no longer there. Version 0.10.0 Can't find it on version 0.9.0 either.
@iced-rs
@iced-rs 6 месяцев назад
As I point out in the video, the text editor widget hasn't been released yet. You can either use it by relying on the `master` branch or the `text-editor` tag of the official repository.
@hawke1133
@hawke1133 6 месяцев назад
@@iced-rs My bad. I misread the code. Derp! Thought that the "text_input" was a widget in the Iced crate. Sorry.
@daodongdu3998
@daodongdu3998 Месяц назад
I followed the code snap and got tokio error "there is no reactor running, must be called from the context of a Tokio 1.x runtime", anyone can help me? thanks
@edema3763
@edema3763 21 день назад
modify the dependencies to 'iced = {version = "0.12.1", features = ["debug", "tokio"]}'
@huairuo
@huairuo 29 дней назад
Excuse me, how can I set an icon for the app?
@Ryco117
@Ryco117 4 месяца назад
It might be useful to mention that the code shown already creates a minimize, maximize and close button on most platforms.. it is just that the presenter chose to use a windowing system with their OS which doesn't show those items 😂
@Dragon20C
@Dragon20C 9 месяцев назад
im getting this compile error. `palette` is ambiguous ambiguous because of multiple potential import sources use `::palette` to refer to this crate unambiguously use `self::palette` to refer to this module unambiguously Fixed: with this replacement: use crate::theme::palette::Palette; instead of what it was before which I think was pub use palette::Palette
@iced-rs
@iced-rs 9 месяцев назад
Update your Rust toolchain and the issue should be fixed! Try `rustup update`.
@Dragon20C
@Dragon20C 9 месяцев назад
I see, thanks!@@iced-rs
@Dragon20C
@Dragon20C 9 месяцев назад
hay man sorry to bother you again im at the stage of adding the async bit into the code so when I run the code it complains about thread '' panicked at 'requires the `rt` Tokio feature flag' the funny thing is I am using the exact version as the one you typed in the tutorial, its asking me to put rt in the features section, which I do and then it complains about reactor not running with this error: thread '' panicked at 'there is no reactor running, must be called from the context of a Tokio 1.x runtime' so what is happening I followed the tutorial up to this point exactly and I cant progress because of this.@@iced-rs
@iced-rs
@iced-rs 9 месяцев назад
@@Dragon20C Try running `cargo update`. If that doesn't work, try enabling the `tokio` feature for the `iced` dependency. I forgot to include that part in the video; I updated the tag yesterday so that it's no longer necessary to enable it manually.
@Dragon20C
@Dragon20C 9 месяцев назад
alright it works now, I think you should make a pinned comment about this so other users dont get confused or experience this issue.@@iced-rs
@mehrnehmen
@mehrnehmen 8 месяцев назад
Thanks for that. Please do a video about multi screen applications. Maybe enhance the text editor with a markdown preview dialog or something. Also the fonts field is not available in iced stable or master branch. How to use icon buttons using stable iced version? EDIT: Got it: font::load(include_bytes!("path/to/icons.ttf").as_slice())
@iced-rs
@iced-rs 8 месяцев назад
Multi-window support hasn't landed yet, but it is scheduled for the next release!
@mehrnehmen
@mehrnehmen 8 месяцев назад
I know. I meant multi screen. Different screens in one window.
@frankstrea2786
@frankstrea2786 7 месяцев назад
What linux is that
@iced-rs
@iced-rs 7 месяцев назад
Arch Linux.
@lareamondmobile
@lareamondmobile 4 месяца назад
i want to like this project, i just can't because the docs are absolute trash. i have to watch a video to find that Sandbox is more suitable for "getting started" than Application, which the examples are in. hard pass.
@lareamondmobile
@lareamondmobile 4 месяца назад
i also want to note that being deaf and having to *watch* documentation is asinine because the automatic captions cover the text you're typing, AND they are awful on their own so... way to be accessible?
@iced-rs
@iced-rs 4 месяца назад
@@lareamondmobile Being deaf doesn't give you the right to be entitled and ungrateful. This library is a gift, and I want to remind you that you simply do not have to use it. No one is forcing you. In any case, if you are so annoyed by watching a video, maybe you could have digged a bit and realize that we actually have an API reference in docs.rs Here's Application: docs.rs/iced/latest/iced/application/trait.Application.html > An Application can execute asynchronous actions by returning a Command in some of its methods. If you do not intend to perform any background work in your program, the Sandbox trait offers a simplified interface. Here's Sandbox: docs.rs/iced/latest/iced/trait.Sandbox.html > A sandboxed Application. If you are a just getting started with the library, this trait offers a simpler interface than Application. We also have a Discord server were we gladly help new users: discord.gg/3xZJ65GAhd You will have to learn to be grateful first, though. Good luck with that!
Далее
Writing My Own Text Editor | Prime Reacts
16:10
Просмотров 92 тыс.
Make Up with Balloons 💄☺️🍓
00:23
Просмотров 2,8 млн
A Tour of Iced 0.10
14:46
Просмотров 22 тыс.
Rust Functions Are Weird (But Be Glad)
19:52
Просмотров 129 тыс.
Makepad: How to use Rust for fast UI - Rik Arends
43:36
I spent six months rewriting everything in Rust
15:11
Просмотров 411 тыс.
Tmux has forever changed the way I write code.
13:30
Просмотров 923 тыс.
I made my own Text Editor (in Rust)
8:16
Просмотров 97 тыс.