Getting started with Rust 🦀 2021: 7a. Building a GUI app in Rust [Part A]

  Рет қаралды 158,871

creativcoder

creativcoder

Күн бұрын

Пікірлер: 111
@Crux161
@Crux161 3 жыл бұрын
This is so refreshing… Documentation, code snippets and advice online, nothing compares to watching someone build something live. I’ve seriously been searching for this exactly topic. 🤦‍♂️ thank you!!
@creativcoder
@creativcoder 3 жыл бұрын
Hey glad you found this helpful!
@jamesb1559
@jamesb1559 3 жыл бұрын
This is an excellent tutorial on gui design in Rust and a welcome tutorial on egui.
@metasim
@metasim 2 жыл бұрын
Your teaching style and editing skills are fantastic! Thank you for sharing your expertise!
@devfagundes
@devfagundes Жыл бұрын
Not even one single code that I get from tutorials in Rust works. So impressive
@xXYourShadowDaniXx
@xXYourShadowDaniXx 3 ай бұрын
Skill Issue
@devfagundes
@devfagundes 3 ай бұрын
@@xXYourShadowDaniXx totally haha
@skoovee
@skoovee 16 күн бұрын
you are watching a old video, its still good for the basics of how egui works but you should be looking at the docs yourself
@theeagleseye4989
@theeagleseye4989 3 жыл бұрын
Great tutorial.. watched a lot of times.. waiting for the next continuation video ..
@codesurge6838
@codesurge6838 2 жыл бұрын
This is more than just Rust GUI tutorial. Thanks for sharing.
@paulmarkert5907
@paulmarkert5907 2 жыл бұрын
Thanks for posting this multi-part series. I am enjoying working through the lessons. One note, the egui crate has versioned up. Some of the equi-related functions used in your code are now deprecated or replaced.
@creativcoder
@creativcoder 2 жыл бұрын
Yes, planning for a follow up video where we go through the fixes
@kagenao2336
@kagenao2336 2 жыл бұрын
this is what i've been looking for... for so long. I do not overexaggerate when I say that this (imo) is close to perfect. (maybe speak a bit louder) Keep up the amazing work!
@creativcoder
@creativcoder 2 жыл бұрын
Thank you, means a lot. Sure, will fine tune my rec setup
@alessio750
@alessio750 2 жыл бұрын
what is the theam used? btw great tutorial dude
@dog1509
@dog1509 3 жыл бұрын
Really looking forward to the second part.
@creativcoder
@creativcoder 3 жыл бұрын
part B: kzbin.info/www/bejne/iaepgZedfNytirM
@aeases-
@aeases- 2 жыл бұрын
just out of curiosity what is the settings/extension/theme your using for the dock in gnome?
@ajinkyax
@ajinkyax 7 ай бұрын
Subscribed. even your website has some great articles. Good one
@creativcoder
@creativcoder 7 ай бұрын
Thank you :) It means a lot.
@spinthma
@spinthma 2 жыл бұрын
and also the immediate compile and the output on the terminal, which plugin do you use?
@Zooiest
@Zooiest Жыл бұрын
What cursor pack do you use?
@princeofexcess
@princeofexcess Жыл бұрын
is there a way to set opacity of 50% on the whole window in iced? transparency setting is not doing anything for me.
@samansamani4477
@samansamani4477 2 жыл бұрын
I just wonder is it possible to create a custom titlebar for it? the default windows one is so big...
@creativcoder
@creativcoder 2 жыл бұрын
It is, you need to set window decorations off from NativeOptions and then make a custom top header with buttons that ties to system close, minimize events
@samansamani4477
@samansamani4477 2 жыл бұрын
@@creativcoder thank you for answer, but then how handle windows movement? can we still hook system movement to new created titlebar?
@saaddahmani1870
@saaddahmani1870 3 жыл бұрын
So great, ... continue please .....
@creativcoder
@creativcoder 3 жыл бұрын
Hey thank you, part B just dropped!
@irfnrdh
@irfnrdh 2 жыл бұрын
this is my first day learn rust and I love it thanks for the tuts
@spinthma
@spinthma 2 жыл бұрын
Very. NIce, by the way which kind of font do you use in vscode? Very clean and readable.
@luizneri
@luizneri 2 жыл бұрын
I'm following this tut, and it seems that ScrollArea::auto_sized() is no more. I got same result with ScrollArea::vertical().auto_shrink([false, false]).show(...)
@creativcoder
@creativcoder 2 жыл бұрын
Hey thanks, I have a new video coming up soon, where we will refactor and update the app to use the most recent egui release. Stay tuned :)
@michaelheisler8501
@michaelheisler8501 2 жыл бұрын
@@creativcoder Hey, I had the same issue and on top the "family_and_size" does not exist anymore. Font sizing and styling has to be done completely different now. I tried to implement the approach from the egui font styling example. Now it looks like this: fn configure_fonts(&self, ctx: &Context){ use FontFamily:: Proportional; let mut font_def = FontDefinitions::default(); font_def.font_data .insert("MesloGS".to_owned(), FontData::from_static(include_bytes!("../../MesloLGS_NF_Regular.ttf"))); font_def.families.get_mut(&FontFamily::Proportional).unwrap() .insert(0, "MesloGS".to_owned()); ctx.set_fonts(font_def); let mut style = (*ctx.style()).clone(); style.text_styles = [ (TextStyle::Heading, FontId::new(35., Proportional)), (TextStyle::Body, FontId::new(20.0, Proportional)), ] .into(); ctx.set_style(style); } This works, but "with_layout" renders the first card always to grab the remaining size of the window. Even when interactively changing the size of the window. The others are rendered as expected.
@RobertoOrtis
@RobertoOrtis Жыл бұрын
Does it compile on windows?
@delusionfish9606
@delusionfish9606 2 жыл бұрын
I failed to make a gui-rs app in the many other frameworks. but this nicely works !! thank you.
@creator0f_in1quity
@creator0f_in1quity 2 жыл бұрын
Hi! What the operation system you use?
@creativcoder
@creativcoder 2 жыл бұрын
I used Ubuntu till ep 8, but now I use arch btw :D
@filmo
@filmo 2 жыл бұрын
Question: Why is 'render_top_panel()' placed into 'impl Headlines' but the helper functions 'render_footer' and 'render_header' are not?
@creativcoder
@creativcoder 2 жыл бұрын
Good catch, there isn't any reason, I might have missed refactoring it while shooting the video. Will make changes
@learntry9074
@learntry9074 Жыл бұрын
Thank you.. see you in 7b :)
@tristansantiago7151
@tristansantiago7151 2 жыл бұрын
This looks really cool. It reminds me of a windows widget.
@CT-cx8yi
@CT-cx8yi 3 жыл бұрын
This is just what I have been looking for. Thanks!
@samansamani4477
@samansamani4477 3 жыл бұрын
thank you, it was awesome, I have a strange question, do you recall what was your program size output in release mode after build, with all dependency?
@creativcoder
@creativcoder 3 жыл бұрын
About 16mb in release. You can reduce it further by following a few applicable ones in: github.com/johnthagen/min-sized-rust
@samansamani4477
@samansamani4477 3 жыл бұрын
@@creativcoder thank you for fast answer, its quiet large... one other question, what backend did you used for gui? and its fully static? (I mean no shared library?) just want to start rust 😅
@creativcoder
@creativcoder 3 жыл бұрын
@@samansamani4477 it uses opengl as its rendering backend with glium crate at present. But you can switch to anything else. static, yes. I believe for opengl deps it maybe uses cdylib underneath.
@samansamani4477
@samansamani4477 3 жыл бұрын
@@creativcoder well I build your project in windows and its worked without problem, except just there was 2 progress bar
@creativcoder
@creativcoder 3 жыл бұрын
@@samansamani4477 better to open an issue on github repository with a screenshot. I'd be able to help better
@hermannpaschulke1583
@hermannpaschulke1583 2 жыл бұрын
Great tutorial! Are you using Gnome on X11? Because I run on Wayland and the window decorations are very ugly. (It's a known gnome issue) Or do you just run headlines using XWayland?
@creativcoder
@creativcoder 2 жыл бұрын
Yeah had to switch back to X11, because obs (recording software) doesn't like wayland :)
@overshifted
@overshifted 2 жыл бұрын
Great video, but I would like to mention that the Imgui library, is actually called "Dear Imgui" and is pronounced "Dear I'm GUI"
@adsick_ua
@adsick_ua 3 жыл бұрын
Great job, keep the level and sure people will be donating to you
2 жыл бұрын
your videos are very good quality and perfect to learn rust, I hope to see more soon. I would prefer the coding part not sped up as we can adjust while viewing, as this where there is a lot to learn too.
@TheGraemi
@TheGraemi 2 жыл бұрын
The voice could be better.
@creativcoder
@creativcoder 2 жыл бұрын
Agree, I generally try to speed up repetitive parts of code. Thanks for the suggestion, will try to keep things realtime for code sections.
@creativcoder
@creativcoder 2 жыл бұрын
Thank you, will look into it
@JXQU3
@JXQU3 Жыл бұрын
Really helpful!
@theeagleseye4989
@theeagleseye4989 3 жыл бұрын
While implementing App trait, how do you auto fill the methods of the trait? Are you using a different rust analyser, mine does not show such options to auto fill
@creativcoder
@creativcoder 3 жыл бұрын
Ah no, that's vscode quick fix shortcut. Hit `Ctrl + .` (dot) to show the quick fix menu. If it's not assigned, go to keyboard shortcuts and look for "problems.action.showQuickFixes" and assign a key.
@theeagleseye4989
@theeagleseye4989 3 жыл бұрын
@@creativcoder thank you very much..
@cyanfroste5559
@cyanfroste5559 2 жыл бұрын
what vscode theme are you using?
@creativcoder
@creativcoder 2 жыл бұрын
That's Bearded Theme Arc: marketplace.visualstudio.com/items?itemName=BeardedBear.beardedtheme
@bankoleogundero9446
@bankoleogundero9446 2 жыл бұрын
How big is the final binary?
@creativcoder
@creativcoder 2 жыл бұрын
cargo build --release gives me ~19 Mb on linux. After using the following flags in Cargo.toml i managed to get it down to 7 Mb: [profile.release] strip = true opt-level = "z" lto = true codegen-units = 1
@jdssl
@jdssl 2 жыл бұрын
The best tutorial!!!
@kingpenguin1905
@kingpenguin1905 2 жыл бұрын
dude awesome. you earned a sub
@peterthecoderd.1210
@peterthecoderd.1210 2 жыл бұрын
Sorry. I have really tried to follow this tutorial as I'd really like to learn. You go through things too fast, beginning with having the implementation fill in automatically at 7:00. I could not get this to work. I paused the playback and tried to enter in the function manually, but all I get is errors. I'm not new to programming, just new to Rust. Right now it seems impossible to learn from your examples.
@creativcoder
@creativcoder 2 жыл бұрын
For errors: Maybe your egui, version might be an upgraded one than the one in the video. For the pace: It you notice the video description it's shot as an "overview video". I'll try to slow down in future videos. Thank you for the feedback.
@VAcharya
@VAcharya 2 жыл бұрын
How can I follow this tutorial on windows machine ?
@ChatterboxBS1
@ChatterboxBS1 2 жыл бұрын
Very nice!
@cakemaster12345
@cakemaster12345 2 жыл бұрын
You forgot to mention in this series how you got the original windows title bar removed and made the new title bar draggable. Kind of an important step...
@creativcoder
@creativcoder 2 жыл бұрын
Correct, there'll be a follow up video on same soon.
@josbexerra8115
@josbexerra8115 2 жыл бұрын
Excelente....gracias saludos de los andes peruanos
@somethingelse5842
@somethingelse5842 3 жыл бұрын
what the system are you using?
@somethingelse5842
@somethingelse5842 3 жыл бұрын
In the left corner, i see "app,places,vscode"
@creativcoder
@creativcoder 3 жыл бұрын
That's Ubuntu 21.04 with Theme: Mc-OS-Transparent-1.3 [GTK2/3] Icons: McMojave-circle-grey-dark [GTK2/3]
@dagher.a247
@dagher.a247 3 жыл бұрын
Great work 👏
@NehaSharma-ld9rx
@NehaSharma-ld9rx 3 жыл бұрын
This is good! 👍
@brunob.7792
@brunob.7792 Жыл бұрын
Google pitchfork will put an end in all this suffering very soon
@codeitlikemiley
@codeitlikemiley 2 жыл бұрын
Im looking for a GUI that can be use on macos native apps, with permissions also can be set up on rust. I think rust makes sense in building native desktop app.
@creativcoder
@creativcoder 2 жыл бұрын
It's almost there, the libraries still need a fair bit of polish tbh
2 жыл бұрын
so it took me hours to develop the same as this 28 min video :D
@creativcoder
@creativcoder 2 жыл бұрын
Yeah, that's the realistic time. I had to speed things up to not bore people watching 3-4 hour of a video :D
@cthutu
@cthutu 2 жыл бұрын
ImGUI is pronounced IM-Gooey, not Image UI. It's an acronym for Immediate Mode Graphic User Interface.
@ursochurrasqueira
@ursochurrasqueira 3 жыл бұрын
amazing tutorial
@adsick_ua
@adsick_ua 2 жыл бұрын
I'd suggest you changing your logo as it is not readable. Think of it in the future.
@creativcoder
@creativcoder 2 жыл бұрын
Thanks for the suggestion, will look into it
@joegriffith1683
@joegriffith1683 2 жыл бұрын
anyone know the extension/setting which automatically displays the type next to each variable and argument? (the light greyed out text)
@creativcoder
@creativcoder 2 жыл бұрын
That's type inlay hints in rust analyzer vscode extension. Just type Ctrl + Shift + P then toggle inlay hints
@manoj88153
@manoj88153 2 жыл бұрын
Make video on iced.
@creativcoder
@creativcoder 2 жыл бұрын
Yeah, iced is good too. Will see
@ino3809
@ino3809 3 жыл бұрын
not wayland?
@creativcoder
@creativcoder 3 жыл бұрын
obs had trouble getting along with wayland, so x11.
@aurorapaisley7453
@aurorapaisley7453 2 жыл бұрын
App::setup is missing??
@creativcoder
@creativcoder 2 жыл бұрын
Yep, in the recent video I have explained how to fix that: kzbin.info/www/bejne/e4CsmaaIrc2JbpI
@theeagleseye4989
@theeagleseye4989 3 жыл бұрын
Can you make some tutorials on druid?
@creativcoder
@creativcoder 3 жыл бұрын
Will do
@saathwik_dasari1
@saathwik_dasari1 3 жыл бұрын
Thanks!
@chiragsingla.
@chiragsingla. 2 жыл бұрын
I love your voice
@alihusham1560
@alihusham1560 2 жыл бұрын
isn't YEW better and faster than this?
@henrylang699
@henrylang699 2 жыл бұрын
faster? it calls web technologies from wasm lol
@alihusham1560
@alihusham1560 2 жыл бұрын
@@henrylang699 oh so EGUI does not depend on javascript at all?
@CaioDanielNunesSantos
@CaioDanielNunesSantos 2 жыл бұрын
Thank you
@buhaytza2005
@buhaytza2005 Жыл бұрын
Thanks
@moose43h
@moose43h 3 жыл бұрын
Wow
@benz201forever
@benz201forever 2 жыл бұрын
I use SLINT for my gui
@benz201forever
@benz201forever 2 жыл бұрын
it's formerly sixtyfps
@creativcoder
@creativcoder 2 жыл бұрын
Yeah, it looks promising for embedded platforms
@stomah9832
@stomah9832 3 жыл бұрын
“image ui”
you need to build a RUST desktop app!!
27:21
Travis Media
Рет қаралды 325 М.
Wait for it 😂
00:19
ILYA BORZOV
Рет қаралды 11 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 70 МЛН
Family Love #funny #sigma
00:16
CRAZY GREAPA
Рет қаралды 38 МЛН
This dad wins Halloween! 🎃💀
01:00
Justin Flom
Рет қаралды 64 МЛН
Simple, Portable, Immediate mode UI with egui
13:45
chris biscardi
Рет қаралды 48 М.
Makepad: Designing modern UIs with Rust - Rik Arends - RustNL 2023
55:20
Rust Nederland (RustNL)
Рет қаралды 54 М.
Build A Rust Frontend (Really FAST Web Apps with Yew)
7:28
Code to the Moon
Рет қаралды 226 М.
Why You Shouldn’t Build Your Next App in Rust
9:18
warpdotdev
Рет қаралды 99 М.
Bevy Egui - Quick Easy Developer Tools and UIs
6:35
Logic Projects
Рет қаралды 18 М.
Build your entire tech stack in Rust
7:22
Let's Get Rusty
Рет қаралды 220 М.
I made my own Text Editor (in Rust)
8:16
FaceDev
Рет қаралды 122 М.
Tauri in 100 Seconds
2:40
Fireship
Рет қаралды 689 М.
Chris Biscardi - Bevy: A case study in ergonomic Rust
54:25
Rust Nation UK
Рет қаралды 15 М.
Распаковка Айфона На Окне 🤯
0:17
Витя Попкин
Рет қаралды 133 М.
Дешёвые клавиатуры - имба!😍
1:00
Корнеич
Рет қаралды 3,1 МЛН