gtk-rs/gtk

gtk::Assistant don't close

Closed this issue · 3 comments

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.

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

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.

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.