From 55d80c829967a86f1840cfa4d51446fdcdcaf3b2 Mon Sep 17 00:00:00 2001
From: Jonathan Harris <jonathan@marginal.org.uk>
Date: Mon, 2 Apr 2018 22:55:53 +0100
Subject: [PATCH] Workaround for https://bugs.python.org/issue25684

---
 myNotebook.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/myNotebook.py b/myNotebook.py
index e93bf545..f65eb4f2 100644
--- a/myNotebook.py
+++ b/myNotebook.py
@@ -144,6 +144,12 @@ class OptionMenu(platform == 'darwin' and tk.OptionMenu or ttk.OptionMenu):
             # OptionMenu derives from Menubutton at the Python level, so uses Menubutton's style
             ttk.OptionMenu.__init__(self, master, variable, default, *values, style='nb.TMenubutton', **kw)
             self['menu'].configure(background = PAGEBG)
+            # Workaround for https://bugs.python.org/issue25684
+            for i in range(0, self['menu'].index('end')+1):
+                self['menu'].entryconfig(i, variable=variable)
         else:
             ttk.OptionMenu.__init__(self, master, variable, default, *values, **kw)
             self['menu'].configure(background = ttk.Style().lookup('TMenu', 'background'))
+            # Workaround for https://bugs.python.org/issue25684
+            for i in range(0, self['menu'].index('end')+1):
+                self['menu'].entryconfig(i, variable=variable)