So each time the user presses the mouse left button, the menu will be poped up. Given a menubutton, and its associated menu, we can create a option menu invoking the menubutton option method. This method accepts a parameter that specifies which menuentry is to considered active. If not specified, it is assumed the first menuentry. The root class is represented by the tkWidget object.
Type follows Tk convention to specify which event is being bound.
Command represents the action to be executed. Remenber that inside the command string we can access the object being bounded using self . It is also available the arg table. Here, the arg table stores the event fields. The function returns a string suitable to be passed as a color attribute value.