self listbox delete(indexself listbox focus_set(del self data[nameself dirty true to delete bookmark we must first find out which bookmark the user has chosenso this method begins with the same lines that the mainwindow editedit(method starts with if exactly one bookmark is selected we pop up message box asking the user whether they really want to delete it if they say yes the message box function returns true and we delete the bookmark from the list box and from the self data dictionaryand set the dirty flag we also set the keyboard focus back to the list box def editshowwebpage(self*ignore)indexes self listbox curselection(if not indexes or len(indexes return index indexes[ url self data[self listbox get(index)webbrowser open_new_tab(urlif the user invokes this method we find the bookmark they have selected and retrieve the corresponding url from the self data dictionary then we use the webbrowser module' webbrowser open_new_tab(function to open the user' web browser with the given url if the web browser is not already runningit will be launched application tkinter tk(path os path join(os path dirname(__file__)"images/"if sys platform startswith("win")icon path "bookmark icoapplication iconbitmap(icondefault=iconelseapplication iconbitmap("@path "bookmark xbm"window mainwindow(applicationapplication protocol("wm_delete_window"window filequitapplication mainloop(the last lines of the program are similar to those used for the interest-tk pyw program we saw earlierbut with three differences one difference is that if the user clicks the program window' close box different method is called for the bookmarks program than the one used for the interest program another difference is that on windows the iconbitmap(method has an additional argument which allows us to specify default icon for all the program' windows--this is not needed on unix platforms since this happens automatically and the last difference is that we set the application' title (in the title