introduction to gui programming when gui program is run it normally begins by creating its main window and all of the main window' widgetssuch as the menu bartoolbarsthe central areaand the status bar once the window has been createdlike server programthe gui program simply waits whereas server waits for client programs to connect to ita gui program waits for user interaction such as mouse clicks and key presses this is illustrated in contrast to console programs in figure the gui program does not wait passivelyit runs an event loopwhich in pseudocode looks like thiswhile trueevent getnextevent(if eventif event =terminatebreak processevent(eventwhen the user interacts with the programor when certain other things occursuch as timer timing out or the program' window being activated (maybe because another program was closed)an event is generated inside the gui library and added to the event queue the program' event loop continuously checks to see whether there is an event to processand if there isit processes it (or passes it on to the event' associated function or method for processingas gui programmers we can rely on the gui library to provide the event loop our responsibility is to create classes that represent the windows and widgets our program needs and to provide them with methods that respond appropriately to user interactions dialog-style programs ||the first program we will look at is the interest program this is dialog-style program ( it has no menus)which the user can use to perform compound interest calculations the program is shown in figure in most object-oriented gui programsa custom class is used to represent single main window or dialogwith most of the widgets it contains being instances of standard widgetssuch as buttons or checkboxessupplied by the library like most cross-platform gui librariestk doesn' really make distinction between window and widget-- window is simply widget that has no widget parent ( it is not contained inside another widgetwidgets that don' have widget parent (windowsare automatically supplied with frame and window decorations (such as title bar and close button)and they usually contains other widgets most widgets are created as children of another widget (and are contained inside their parent)whereas windows are created as children of the tkinter tk