summaryrefslogtreecommitdiff
path: root/Lib/idlelib/configdialog.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/configdialog.py')
-rw-r--r--Lib/idlelib/configdialog.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py
index 2f95c9ccaa..2235973587 100644
--- a/Lib/idlelib/configdialog.py
+++ b/Lib/idlelib/configdialog.py
@@ -149,17 +149,19 @@ class ConfigDialog(Toplevel):
else:
padding_args = {'padding': (6, 3)}
outer = Frame(self, padding=2)
- buttons = Frame(outer, padding=2)
+ buttons_frame = Frame(outer, padding=2)
+ self.buttons = {}
for txt, cmd in (
('Ok', self.ok),
('Apply', self.apply),
('Cancel', self.cancel),
('Help', self.help)):
- Button(buttons, text=txt, command=cmd, takefocus=FALSE,
- **padding_args).pack(side=LEFT, padx=5)
+ self.buttons[txt] = Button(buttons_frame, text=txt, command=cmd,
+ takefocus=FALSE, **padding_args)
+ self.buttons[txt].pack(side=LEFT, padx=5)
# Add space above buttons.
Frame(outer, height=2, borderwidth=0).pack(side=TOP)
- buttons.pack(side=BOTTOM)
+ buttons_frame.pack(side=BOTTOM)
return outer
def ok(self):
@@ -205,7 +207,6 @@ class ConfigDialog(Toplevel):
Attributes accessed:
note
-
Methods:
view_text: Method from textview module.
"""
@@ -852,6 +853,7 @@ class HighPage(Frame):
text.configure(
font=('courier', 12, ''), cursor='hand2', width=1, height=1,
takefocus=FALSE, highlightthickness=0, wrap=NONE)
+ # Prevent perhaps invisible selection of word or slice.
text.bind('<Double-Button-1>', lambda e: 'break')
text.bind('<B1-Motion>', lambda e: 'break')
string_tags=(
@@ -1284,8 +1286,7 @@ class HighPage(Frame):
theme_name - string, the name of the new theme
theme - dictionary containing the new theme
"""
- if not idleConf.userCfg['highlight'].has_section(theme_name):
- idleConf.userCfg['highlight'].add_section(theme_name)
+ idleConf.userCfg['highlight'].AddSection(theme_name)
for element in theme:
value = theme[element]
idleConf.userCfg['highlight'].SetOption(theme_name, element, value)
@@ -1730,8 +1731,7 @@ class KeysPage(Frame):
keyset_name - string, the name of the new key set
keyset - dictionary containing the new keybindings
"""
- if not idleConf.userCfg['keys'].has_section(keyset_name):
- idleConf.userCfg['keys'].add_section(keyset_name)
+ idleConf.userCfg['keys'].AddSection(keyset_name)
for event in keyset:
value = keyset[event]
idleConf.userCfg['keys'].SetOption(keyset_name, event, value)