Search code examples
python-3.xgtkglade

Link to website in Gtk.MenuBar using Glade


What is the best way to create a menuitem (for the Gtk.MenuBar) that should open the default browser with a new tab and loading an URL?

Is it possible to do that in Glade directly or do I need to create that function in the program code itself? Is there a preferred way in Python 3 to do that?


Solution

  • After a lot of searching for a Glade-only solution, I think that Gtk.Menuitem doesn't have a URL-open option. I now just defined on_menuitem_clicked-function that uses:

    webbrowser.open_new_tab()

    from the standard library.