Skip to content

Instantly share code, notes, and snippets.

@sireliah
Created February 13, 2019 18:26
Show Gist options
  • Select an option

  • Save sireliah/1791c8a56e6311367b7470509da5894e to your computer and use it in GitHub Desktop.

Select an option

Save sireliah/1791c8a56e6311367b7470509da5894e to your computer and use it in GitHub Desktop.
let generate_button = Button::new_with_label("Generate spiral");
generate_button.connect_clicked(clone!(
box_vert, image_gtk, spiral => move |_| {
// Remove existing image from layout box
box_vert.remove(&image_gtk);
// Generate new image
let image_gtk: gtk::Image = spiral.generate_to_gtk();
// Put new image to the layout box
box_vert.pack_start(&image_gtk, false, false, 20);
window.show_all();
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment