Closed MGlolenstine closed 4 years ago
You have to clone the window before you move it into the closure:
let window = self.window.clone();
button.connect_clicked(move |c| {
window.close();
});
There's also a clone!
macro in glib to take care of this.
clone!
macro and the above code did solve my problem
Thanks!
I'm unsure on how to close a popup window from within, as I cannot use the
connect_clicked
withself
to get the window object. Whenever a person clicks on the "Ok" button, I'd like to close the popup. I've already tried usingbut it doesn't work, as it says that it can't use the
self
, because it's not static.This is the snippet of my widget.