introduction to gui programming barin the mainwindow class' methods rather than here for the interest program the title never changedso it needed to be set only oncebut for the bookmarks program we change the title text to include the name of the bookmarks file being worked on now that we have seen the implementation of the main window' class and the code that initializes the program and starts off the event loopwe can turn our attention to the addeditform dialog creating custom dialog |the addeditform dialog provides means by which users can add and edit bookmark names and urls it is shown in figure where it is being used to edit an existing bookmark (hence the "editin the titlethe same dialog can also be used for adding bookmarks we will begin by reviewing the dialog' initializerbroken into four parts figure the bookmarks program' add/edit dialog class addeditform(tkinter toplevel)def __init__(selfparentname=noneurl=none)super(__init__(parentself parent parent self accepted false self transient(self parentself title("bookmarks "editif name is not none else "add")self namevar tkinter stringvar(if name is not noneself namevar set(nameself urlvar tkinter stringvar(self urlvar set(url if url is not none else "we have chosen to inherit tkinter toplevela bare widget designed to serve as base class for widgets used as top-level windows we keep reference to the parent and create self accepted attribute and set it to false the call to the transient(method is done to inform the parent window that this window must always appear on top of the parent the title is set to indicate adding or editing depending on whether name and url have been passed in two