gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.25k stars 82 forks source link

gtk::Assistant don't close #1038

Closed hetogs closed 4 years ago

hetogs commented 4 years ago

In crate version 0.9 we need to call gtk::GtkWindow::close() instead gtk::Widget::destroy() because destroy() is marked as unsafe but with gtk::Assistant call to this function do nothing, the assistant do not close.

sdroege commented 4 years ago

@ebassi What's the correct way of closing an assistant?

sdroege commented 4 years ago

The best place to ask about this would be on https://discourse.gnome.org . As this is not a bug or feature request, let's close it here.

ebassi commented 4 years ago

Sorry, I missed the notification.

GtkAssistant does not allow closing itself in the middle of a progress page; if you try doing that, it will emit the "cancel" signal, which will let you handle the case. At that point, you might want to hide the assistant window, schedule an idle callback, and call unsafe { assistant.destroy(); } when you know nothing else is holding a reference to it.

Alternatively, you can connect to the delete-event signal and return true from your handler, which will skip the default behaviour.