window self parent winfo_toplevel(window columnconfigure( weight= window rowconfigure( weight= self parent geometry("{ } { }+{ }+{ }format( )self parent title("bookmarks unnamed"the columnconfigure(and rowconfigure(methods allow us to give weightings to grid we begin with the window framegiving all the weight to the first column and the second row (which is occupied by the list box)so if the frame is resized any excess space is given to the list box on its own this is not sufficientwe must also make the top-level window that contains the frame resizableand we do this by getting reference to the window using the wininfo_toplevel(methodand then making the window resizable by setting its row and column weights to at the end of the initializer we set an initial window size and position using string of the form widthxheight+ + (if we wanted to set only the size we could use the form widthxheight instead finallywe set the window' titlethereby completing the window' user interface if the user clicks toolbar button or chooses menu option method is called to carry out the required action and some of these methods rely on helper methods we will now review all the methods in turnstarting with one that is called five seconds after the program starts def clearstatusbar(self)self statusbar["text""the status bar is simple tkinter label we could have used lambda expression in the after(method call to clear itbut since we need to clear the status bar from more than one place we have created method to do it def filenew(self*ignore)if not self okaytocontinue()return self listbox delete( tkinter endself dirty false self filename none self data {self parent title("bookmarks unnamed"if the user wants to create new bookmarks file we must first give them the chance to save any unsaved changes in the existing file if there is one this is factored out into the mainwindow okaytocontinue(method since it is used in few different places the method returns true if it is okay to continueand false otherwise if continuingwe clear the list box by deleting all its entries