code: def mk_tab_context_menu(callback_object):
      
      # Store the menu in a temp variable in terminal so that popup() is happy. See:
      #   https://stackoverflow.com/questions/28465956/
      callback_object.context_menu = Gtk.Menu()
      menu = callback_object.context_menu
      mi1 = Gtk.MenuItem(_("New Tab"))
      mi1.connect("activate", callback_object.on_new_tab)
      menu.add(mi1)
      mi2 = Gtk.MenuItem(_("Rename"))
      mi2.connect("activate", callback_object.on_rename)
      menu.add(mi2)
      mi3 = Gtk.MenuItem(_("Close"))
      mi3.connect("activate", callback_object.on_close)
      menu.add(mi3)
      menu.show_all()
      return menu
docs: Create the context menu for a notebook tab