[gtk-web: 4/5] Update the rust sample code




commit 908197da87ab60afbc04465a82b21963cac2f552
Author: Julian Hofer <julianhofer gnome org>
Date:   Sat Aug 14 22:23:29 2021 +0200

    Update the rust sample code

 _data/sample_codes.yml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/_data/sample_codes.yml b/_data/sample_codes.yml
index c26537d..5b29851 100644
--- a/_data/sample_codes.yml
+++ b/_data/sample_codes.yml
@@ -113,7 +113,7 @@ codes:
     snippet: |
       ```rust
       use glib::clone;
-      // glib and other dependencies are re-exported from the gtk crate
+      // glib and other dependencies are re-exported by the gtk crate
       use gtk::glib;
       use gtk::prelude::*;
 
@@ -130,8 +130,10 @@ codes:
       }
 
       fn main() {
-          // Create a new application
-          let app = gtk::Application::new(Some("com.github.gtk-rs.examples.basic"), Default::default());
+          // Create a new application with the builder pattern
+          let app = gtk::Application::builder()
+              .application_id("com.github.gtk-rs.examples.basic")
+              .build();
           app.connect_activate(on_activate);
           // Run the application
           app.run();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]