Building A Simple App With Rust And GTK

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 63

  • @DGDG0000000
    @DGDG0000000 9 месяцев назад +6

    The best tutorial to implement Rust and Gtk together on the first step to go with.

  • @root8272
    @root8272 2 года назад +73

    Small correction. GTK pre-dates GNOME, and originally stood for "GIMP Toolkit", since it was a widget toolkit created for use by The GIMP project. GIMP stands for "GNU Image Manipulation Program", so technically speaking, the "G" in GTK, stands for "GNU" (where the "G" stands for nothing but itself). However, today GTK doesn't actually stand for anything. It is no longer an acronym.

    • @ruben6295
      @ruben6295 Год назад +2

      Gnu is an animal name

    • @iusedtolikethisgame2468
      @iusedtolikethisgame2468 Год назад +6

      @@ruben6295 GNU in this case stands for "GNU's not Unix!" so root is correct that it stands for itself

  • @ajdinmasic4842
    @ajdinmasic4842 8 месяцев назад +3

    Just an FYI, you don't need the "move" in "move |_|...."
    There aren't variables to capture in this case to force it into a closure. So you can just use |_| without move.
    I'm still learning Rust so correct me if my description is wrong or doesn't make sense! Thanks!

  •  2 года назад +14

    Wonderful tutorial! Amazing how much you were able to cover in such a short time span. Very efficient and straight to the point :) I hope you make more tutorials!

  • @kosqx
    @kosqx 2 года назад +6

    Great tutorial! I was thinking that doing GUI in Rust must be hard but you managed to disprove it in mere 16 minutes. Thanks!

  • @sagarlondhe1262
    @sagarlondhe1262 2 года назад +1

    You are literally the best, I've been looking for a tutorial for three days and yours works

  • @kentwest8831
    @kentwest8831 8 месяцев назад +2

    Excellent video. Gives me my next steps. I had fumbled about the 'net trying to figure this out on my own, and got part way there. Mine is a bit simpler, but probably going in the wrong direction:
    use gtk::prelude::*;
    use gtk::{Button, Window, WindowType};
    use std::process;
    fn main() {
    gtk::init().expect("Failure initializing GTK.");
    let window = Window::new(WindowType::Toplevel);
    let button = Button::with_label("Click Me to Exit");
    button.connect_clicked(move |_| { process::exit(1); });
    window.add(&button);
    window.show_all();
    gtk::main();
    }

  • @abba_m_
    @abba_m_ 2 года назад +2

    This is nice. You've put me on a whole new level of learning rust. Looking forward to more rust content on this channel. THANKS

  • @memento_mori_dori
    @memento_mori_dori 2 года назад

    Amazing clear and calming voice, works great to watch the tutorial before going to bed. Tomorrow will definitely try to build my first app with GTK, sounds like an easy functional kit

  • @doniputra2916
    @doniputra2916 2 года назад

    What a legend only one ad in the beginning . Your so damn underrated

  • @DavidAlsh
    @DavidAlsh 3 месяца назад +1

    Would love an expansion to this with libadwaita. Going through the tutorials and I'm struggling to make an idiomatic Gnome-themed app

  • @1879heikkisorsa
    @1879heikkisorsa 2 года назад +1

    Nice! I like to see more of such hands-on tutorials!

  • @gzoechi
    @gzoechi Год назад

    That looks much better now than the last time I tried

  • @Dus3826
    @Dus3826 2 года назад +1

    Thank you! Nice introduction to a simple UI giving me motivation to give it a try myself.

  • @cna9708
    @cna9708 Год назад

    Good example. Exactly what I needed.

  • @fikrirahmatnurhidayat4988
    @fikrirahmatnurhidayat4988 Год назад

    This is actually good man. thanks for the video.

  • @corbindavenport
    @corbindavenport 2 года назад +8

    5:38 🐈

  • @noloplanificamosniunpoquito
    @noloplanificamosniunpoquito 2 года назад

    soft just keeps getting better

  • @morningstar2219
    @morningstar2219 Год назад +1

    Thank's a lot bro !!

  • @xlimoncito7354
    @xlimoncito7354 2 года назад

    ITS WORKING! nice job dude

  • @carmelostagno6352
    @carmelostagno6352 2 года назад

    Great video. Thank you for all. Can you provide more about rust gui?

  • @oglothenerd
    @oglothenerd Год назад +1

    Hello, fellow small tech RUclipsr!

  • @io_inc
    @io_inc 2 года назад +2

    How the F%%K do you still have less than a 1000 subscribers??? This a great f###king video!!!

  • @washidbasith
    @washidbasith 2 года назад

    good work king, love you

  • @MicroUrb
    @MicroUrb Год назад

    So I am on an Ubuntu desktop which does not have support for GTK4 and append method is from GTK4, what is the GTK3 version of append?

  • @immanuel5513
    @immanuel5513 6 месяцев назад

    great job, but how to bundle an release executable file and installer ?

  • @SANDEEPKUMAR-ff8hg
    @SANDEEPKUMAR-ff8hg 2 года назад

    Did you get fruity or producer edition? Im looking to buy soft soft but i dont know if Producer edition is worth it...

  • @alexissalas8825
    @alexissalas8825 2 года назад

    Hi there. Your video made me curious about GTK and Rust, so I tried it myself and playing with it I wonder if it would be possible to create multiple threads aside of the GTK-GUI where the Labels and Buttons interact with each other but also with threads outside the GTK-Application to share data in-between. Getting warm with Rust is a little pain in the a**, since the type-safety of Rust is giving a very hard time. As a little experiment I would like to take an Arduino with some sensors and would like to send UDP-packets over WiFi to my PC where a little Rust-Programm with a GTK-GUI displays temperature, pressure, humidity, etc. ... Do you have experience in these kind of architectures?

    • @jakewestall5201
      @jakewestall5201  2 года назад +1

      So I don't have much experience with Arduino, however I'm very familiar with threaded programming and Raspberry PIs. I'll look into this sort of thing for future videos.

    • @alexissalas8825
      @alexissalas8825 2 года назад

      @@jakewestall5201 I'm looking forward to it :D

  • @startnow3281
    @startnow3281 2 года назад

    That was great. Thank you.

  • @Pesthuf
    @Pesthuf 2 года назад +1

    I can't stand to go back to the ancient mess pattern of mixing ui and state and rebuilding the app and redoing every step every time I change something. Not when toolkits in other languages provide things like stateful hot reload, proper state management and having UI as a function of state.
    I hope rust gets a proper, modern UI Framework soon.

  • @MarKac9090
    @MarKac9090 2 года назад

    interesting video I like it. btw. your "My rust tutorial part " links are broken can you pls fix?

    • @jakewestall5201
      @jakewestall5201  2 года назад +1

      Should be fixed now. Moved blogging platforms and forgot to update those links. Thanks for the reminder

    • @MarKac9090
      @MarKac9090 2 года назад

      @@jakewestall5201 works now thanks! and part 3 Yes please :)

  • @rathodsiddharajsinh9010
    @rathodsiddharajsinh9010 2 года назад

    like What are the basics you need to learn to produce a , or setup it. Also I need to learn how to add soft notes to a .

  • @itsabhiyan
    @itsabhiyan 7 месяцев назад

    how are you writing rust without lsp??

  • @김태현-o5o6f
    @김태현-o5o6f 2 года назад

    what linux distro are you using now??

  • @khidirmahamat2103
    @khidirmahamat2103 2 года назад

    Thank you for this! Super cool video! A+++

  • @PizzaLovingNerd
    @PizzaLovingNerd 2 года назад +6

    I got a really stupid question... How on earth do you get a more complicated GTK app to build? No matter how many "devel" packages I've tried on Fedora and OpenSUSE, my projects will never build unless it's Gtk3 instead of Gtk4.

    • @jakewestall5201
      @jakewestall5201  2 года назад +3

      No such thing as a stupid question. How complex are we talking? I believe in the gtk-rs book it says you need to build with meson for the more complex applications. Usually the build errors have some handy insight into what's not working.

    • @root8272
      @root8272 2 года назад +3

      Analyze the output of cargo's build process, and see which dependency it fails on. If it's failing on gtk4, then the package you need (at least on Fedora) is "gtk4-devel". If you're using libadwaita as well, and fails while building that dependency, you'll want to install "libadwaita-devel". That should be everything. If that doesn't work, come back here, and feel free to post the offending part of the `cargo build` output. It should give us a better idea of what else could be wrong.

  • @bomsh_channel
    @bomsh_channel 2 года назад

    Cool video, but it's gtk4 and my desktop theme does not support gtk4 so it's a deal-breaker for me bruh. Is it harder to make gtk3 app?

    • @jakewestall5201
      @jakewestall5201  2 года назад +1

      To my knowledge, for something simple like this no. Idk what theme you use but it shouldn't be too hard to add gtk4 support. It's apps that are written with the libadwaita libraries that won't support theming.

  • @Rayer24
    @Rayer24 Месяц назад

    it takes at least 30 seconds for me to compile a demo project what only took you a second basically.

  • @ricardo_krohn
    @ricardo_krohn Год назад +1

    boa!!!! 🇧🇷🇧🇷🇧🇷

  • @nagendrapriyadarshi2926
    @nagendrapriyadarshi2926 2 года назад

    How? Could you please give ? It will be very helpfull!

  • @dvPro-bq9oh2ll1b
    @dvPro-bq9oh2ll1b Год назад +1

    build error on windows...

  • @htpkey
    @htpkey Месяц назад

    Rich Evans?

  • @craneology
    @craneology 2 года назад

    better mic = more subs, good content.

  • @SandraMartinez-b6x
    @SandraMartinez-b6x Месяц назад

    Kali Point

  • @DunlopAlan-m8c
    @DunlopAlan-m8c Месяц назад

    Vern Plain

  • @Avengerie
    @Avengerie 2 года назад

    RedLetterMedia doesn’t pay enough, huh, Rich?

  • @emmanuelevans-anfom5399
    @emmanuelevans-anfom5399 2 года назад

    I'm so powerful, I don't need batteries to play

  • @nitinsharma0509
    @nitinsharma0509 2 года назад

    I recommend this crack

  • @jebbbungo7873
    @jebbbungo7873 2 года назад

    This is horrible! I can't believe my eyes! Vim?! EWWWWW!
    This post made by EmacsGang. Also good vid tho fr

  • @jojoii7287
    @jojoii7287 6 месяцев назад +1

    Hey, i got an error at the state at 7:00:
    when i run "cargo run", it opens a console with:
    (app.exe:17036): Gsk-CRITICAL **: 12:59:41.536: Failed to load shader program: Compilation failure in shader.
    Source Code:
    1| #version 440
    2| #define N_TEXTURES 16
    3| #define N_EXTERNAL_TEXTURES 0
    4| #define GSK_VERTEX_SHADER 1
    5| #define GSK_VARIATION 2u
    6| #define GSK_SHADER_CLIP GSK_GPU_SHADER_CLIP_NONE
    7| #ifndef _COMMON_
    8| #define _COMMON_
    and 2000 more code line appears in the console
    Do you khnow how i can fix this shader error?

    • @sercascade
      @sercascade 16 часов назад

      i got the same error but it went away when i replaced "use gkt::gio::Application;" with "use::Application;"
      im not sure why the rust analyzer automatically defaults to using gtk::gio::Application but it doesnt work
      if that still doesnt work then idk whats wrong with it