diff -r 82ccdf2df5ac Lib/idlelib/AutoCompleteWindow.py --- a/Lib/idlelib/AutoCompleteWindow.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/AutoCompleteWindow.py Sun Aug 02 11:36:41 2015 +0300 @@ -2,6 +2,7 @@ An auto-completion window for IDLE, used by the AutoComplete extension """ from tkinter import * +from idlelib.ttkcompat import Scrollbar from idlelib.MultiCall import MC_SHIFT from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES diff -r 82ccdf2df5ac Lib/idlelib/Debugger.py --- a/Lib/idlelib/Debugger.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/Debugger.py Sun Aug 02 11:36:41 2015 +0300 @@ -1,6 +1,7 @@ import os import bdb from tkinter import * +from idlelib.ttkcompat import Scrollbar from idlelib.WindowList import ListedToplevel from idlelib.ScrolledList import ScrolledList from idlelib import macosxSupport diff -r 82ccdf2df5ac Lib/idlelib/ScrolledList.py --- a/Lib/idlelib/ScrolledList.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/ScrolledList.py Sun Aug 02 11:36:41 2015 +0300 @@ -1,4 +1,5 @@ from tkinter import * +from idlelib.ttkcompat import Scrollbar class ScrolledList: diff -r 82ccdf2df5ac Lib/idlelib/TreeWidget.py --- a/Lib/idlelib/TreeWidget.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/TreeWidget.py Sun Aug 02 11:36:41 2015 +0300 @@ -16,7 +16,7 @@ import os from tkinter import * - +from idlelib.ttkcompat import Scrollbar from idlelib import ZoomHeight from idlelib.configHandler import idleConf diff -r 82ccdf2df5ac Lib/idlelib/compat.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/idlelib/compat.py Sun Aug 02 11:36:41 2015 +0300 @@ -0,0 +1,24 @@ +import tkinter +from tkinter import ttk + +use_ttk = None + +def check_ttk(master): + global use_ttk + if use_ttk is None: + master = ttk.setup_master(master) + try: + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + ttk._load_tile(master) + except tkinter.TclError: + use_ttk = False + else: + use_ttk = True + return use_ttk + +def Scrollbar(master, *args, **kwargs): + if check_ttk(master): + return ttk.Scrollbar(master, *args, **kwargs) + else: + return tkinter.Scrollbar(master, *args, **kwargs) diff -r 82ccdf2df5ac Lib/idlelib/configDialog.py --- a/Lib/idlelib/configDialog.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/configDialog.py Sun Aug 02 11:36:41 2015 +0300 @@ -10,6 +10,7 @@ Refer to comments in EditorWindow autoin """ from tkinter import * +from idlelib.ttkcompat import Scrollbar import tkinter.messagebox as tkMessageBox import tkinter.colorchooser as tkColorChooser import tkinter.font as tkFont diff -r 82ccdf2df5ac Lib/idlelib/idle_test/htest.py --- a/Lib/idlelib/idle_test/htest.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/idle_test/htest.py Sun Aug 02 11:36:41 2015 +0300 @@ -68,6 +68,7 @@ OutputWindow.OutputWindow (indirectly be from importlib import import_module from idlelib.macosxSupport import _initializeTkVariantTests import tkinter as tk +from idlelib.ttkcompat import Scrollbar AboutDialog_spec = { 'file': 'aboutDialog', @@ -347,7 +348,7 @@ def run(*tests): frameLabel.pack() text = tk.Text(frameLabel, wrap='word') text.configure(bg=root.cget('bg'), relief='flat', height=4, width=70) - scrollbar = tk.Scrollbar(frameLabel, command=text.yview) + scrollbar = Scrollbar(frameLabel, command=text.yview) text.config(yscrollcommand=scrollbar.set) scrollbar.pack(side='right', fill='y', expand=False) text.pack(side='left', fill='both', expand=True) diff -r 82ccdf2df5ac Lib/idlelib/keybindingDialog.py --- a/Lib/idlelib/keybindingDialog.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/keybindingDialog.py Sun Aug 02 11:36:41 2015 +0300 @@ -2,6 +2,7 @@ Dialog for building Tkinter accelerator key bindings """ from tkinter import * +from idlelib.ttkcompat import Scrollbar import tkinter.messagebox as tkMessageBox import string import sys diff -r 82ccdf2df5ac Lib/idlelib/textView.py --- a/Lib/idlelib/textView.py Tue Jul 28 00:06:31 2015 +0300 +++ b/Lib/idlelib/textView.py Sun Aug 02 11:36:41 2015 +0300 @@ -3,6 +3,7 @@ """ from tkinter import * +from idlelib.ttkcompat import Scrollbar import tkinter.messagebox as tkMessageBox class TextViewer(Toplevel): @@ -50,7 +51,11 @@ class TextViewer(Toplevel): self.buttonOk = Button(frameButtons, text='Close', command=self.Ok, takefocus=FALSE) self.scrollbarView = Scrollbar(frameText, orient=VERTICAL, - takefocus=FALSE, highlightthickness=0) + takefocus=FALSE) + try: + self.scrollbarView['highlightthickness']=0 + except TclError: + pass self.textView = Text(frameText, wrap=WORD, highlightthickness=0, fg=self.fg, bg=self.bg) self.scrollbarView.config(command=self.textView.yview) diff -r 82ccdf2df5ac Lib/idlelib/ttkcompat.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Lib/idlelib/ttkcompat.py Sun Aug 02 11:36:41 2015 +0300 @@ -0,0 +1,24 @@ +import tkinter +from tkinter import ttk + +use_ttk = None + +def check_ttk(master): + global use_ttk + if use_ttk is None: + master = ttk.setup_master(master) + try: + if not getattr(master, '_tile_loaded', False): + # Load tile now, if needed + ttk._load_tile(master) + except tkinter.TclError: + use_ttk = False + else: + use_ttk = True + return use_ttk + +def Scrollbar(master, *args, **kwargs): + if check_ttk(master): + return ttk.Scrollbar(master, *args, **kwargs) + else: + return tkinter.Scrollbar(master, *args, **kwargs)