I am running a small html file inside a python window using webkit2gtk. I have disabled the gtk title bar, and there is a close and minimize button in the html page itself.
Now, I want to close the window when that close button is clicked. Previously I used webkitgtk, and there webkit could sense the change in title of the html file, and would close the window when the title was changed (not just close, minimize and dragging were also implemented in this method. It would disable dragging when the mouse hovered over a button in html).
def title_changed(widget, frame, title):
print(title)
if title == "close":
Gtk.main_quit()
elif title == "minimize":
self.window.iconify()
self.webview.connect('title-changed', title_changed)
Now I want to port the code to webkit2gtk.
However, it looks like the title-changed call, which was available in webkitgtk has been removed in webkit2gtk. So, how to handle close and other events, that is, how to make python do something to the window, when a button is clicked (which is handled by JS)?
If title-change is not available anymore, what other option is there?