Skip to content

Commit

Permalink
library: Add rust demo Image
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Sabrina committed Sep 6, 2023
1 parent e6f0a7f commit 3370304
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Library/demos/Image/code.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use crate::workbench;
use gtk::gio;
use gtk::prelude::*;

pub fn main() {
let path = gio::File::for_uri(&workbench::resolve("workbench.png"))
.path()
.unwrap()
.display()
.to_string();

let tmp1: gtk::Image = workbench::builder().object("icon1").unwrap();
tmp1.set_file(Some(&path));
let tmp2: gtk::Image = workbench::builder().object("icon2").unwrap();
tmp2.set_file(Some(&path));
let tmp3: gtk::Image = workbench::builder().object("icon3").unwrap();
tmp3.set_file(Some(&path));
}

0 comments on commit 3370304

Please sign in to comment.