Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dbfe92cd
Commit
dbfe92cd
authored
Mar 18, 2002
by
Steven M. Gava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further work on dynamic reconfiguration;
keybindings
parent
b845f3b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
Lib/idlelib/EditorWindow.py
Lib/idlelib/EditorWindow.py
+33
-0
Lib/idlelib/configDialog.py
Lib/idlelib/configDialog.py
+1
-0
No files found.
Lib/idlelib/EditorWindow.py
View file @
dbfe92cd
...
@@ -492,6 +492,39 @@ class EditorWindow:
...
@@ -492,6 +492,39 @@ class EditorWindow:
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
),
idleConf
.
GetOption
(
'main'
,
'EditorWindow'
,
'font-size'
),
fontWeight
))
fontWeight
))
def
ResetKeybindings
(
self
):
#this function is called from configDialog.py
#to update the keybindings if they are changed
self
.
Bindings
.
default_keydefs
=
idleConf
.
GetCurrentKeySet
()
keydefs
=
self
.
Bindings
.
default_keydefs
for
event
,
keylist
in
keydefs
.
items
():
self
.
text
.
event_delete
(
event
)
self
.
apply_bindings
()
#update menu accelerators
menuEventDict
=
{}
for
menu
in
self
.
Bindings
.
menudefs
:
menuEventDict
[
menu
[
0
]]
=
{}
for
item
in
menu
[
1
]:
if
item
:
menuEventDict
[
menu
[
0
]][
prepstr
(
item
[
0
])[
1
]]
=
item
[
1
]
for
menubarItem
in
self
.
menudict
.
keys
():
menu
=
self
.
menudict
[
menubarItem
]
end
=
menu
.
index
(
END
)
+
1
for
index
in
range
(
0
,
end
):
if
menu
.
type
(
index
)
==
'command'
:
accel
=
menu
.
entrycget
(
index
,
'accelerator'
)
if
accel
:
itemName
=
menu
.
entrycget
(
index
,
'label'
)
event
=
''
if
menuEventDict
.
has_key
(
menubarItem
):
if
menuEventDict
[
menubarItem
].
has_key
(
itemName
):
event
=
menuEventDict
[
menubarItem
][
itemName
]
if
event
:
#print 'accel was:',accel
accel
=
get_accelerator
(
keydefs
,
event
)
menu
.
entryconfig
(
index
,
accelerator
=
accel
)
#print 'accel now:',accel,'\n'
def
saved_change_hook
(
self
):
def
saved_change_hook
(
self
):
short
=
self
.
short_title
()
short
=
self
.
short_title
()
long
=
self
.
long_title
()
long
=
self
.
long_title
()
...
...
Lib/idlelib/configDialog.py
View file @
dbfe92cd
...
@@ -1096,6 +1096,7 @@ class ConfigDialog(Toplevel):
...
@@ -1096,6 +1096,7 @@ class ConfigDialog(Toplevel):
for
instance
in
winInstances
:
for
instance
in
winInstances
:
instance
.
ResetColorizer
()
instance
.
ResetColorizer
()
instance
.
ResetFont
()
instance
.
ResetFont
()
instance
.
ResetKeybindings
()
def
Cancel
(
self
):
def
Cancel
(
self
):
self
.
destroy
()
self
.
destroy
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment