Focus keeps returning to the first OptionMenu selected
<p>I'm writing an app that has multiple instances of <code>OptionMenu</code> and I can't get focus to traverse properly between them.  This is a two-part question.</p>

<p><em>First</em>, my original problem was that once you selected an item from one of the menus, focus would always return to that menu every time you made a selection in a different menu.  So if you selected an option in menu 1, then tabbed to menu 2 and made a selection there, the next tab would take you back to menu 1 instead of to menu 3.  I "fixed" this problem with the function <code>menu_MacGyver()</code>, but I would like a more elegant solution.</p>

<p><em>Second</em>, the "fixed" code still has a bug.  Even though focus traverses all three menus now, the first menu selected still shows a highlight (as if it's in focus) whenever either of the other menus drops down.  I'm not sure how the program is even remembering which <code>OptionMenu</code> was selected first, so I haven't been able to make it forget.</p>

<p>Here's the problem section of code:</p>

<pre><code>    class MyApp:
        def __init__(self, parent):
            self.parent = parent
            self.mainFrame = Frame(parent, padx=10, pady=10)
            self.mainFrame.pack(side=TOP, anchor=CENTER)

            parent.bind_class("Menubutton", "&lt;Down&gt;",
                              lambda event: self.menu_MacGyver(event))

            self.report_format = StringVar()
            self.report_format.set("Non-spreadsheet overload report")
            self.base_case_rating = StringVar()
            self.base_case_rating.set("Rate B")
            self.contingency_rating = StringVar()
            self.contingency_rating.set("Rate B")

            self.report_format_options_str = ["Spreadsheet overload report",
                                              "Spreadsheet loading table",
                                              "Available capacity table",
                                              "Non-spreadsheet overload report",
                                              "Non-spreadsheet loading table",
                                              "Non-converged network",
                                              "Non-spreadsheet corrective actions"]
            option1 = OptionMenu(self.mainFrame,
                                 self.report_format,
                                 *self.report_format_options_str)
            option1.config(takefocus=1)
            option1.pack(side=TOP, anchor=NW)

            self.rating_options_str = ["Rate A", "Rate B", "Rate C"]
            option2 = OptionMenu(self.mainFrame,
                                 self.base_case_rating,
                                 *self.rating_options_str)
            option2.config(takefocus=1)
            option2.pack(side=TOP, anchor=NW)

            option3 = OptionMenu(self.mainFrame,
                                 self.contingency_rating,
                                 *self.rating_options_str)
            option3.config(takefocus=1)
            option3.pack(side=BOTTOM, anchor=NW)

        def menu_MacGyver(self, event):
            event.widget.event_generate("&lt;space&gt;")
            event.widget.config(takefocus=0)
            event.widget.focus_set()
            event.widget.config(takefocus=1)

    root = Tk()
    GUI = MyApp(root)
    root.mainloop()
</code></pre>