Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
01e35754
Kaydet (Commit)
01e35754
authored
Haz 10, 2016
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue *24750: Switch all scrollbars in IDLE to ttk versions.
Where needed, add minimal tests to cover changes.
üst
96881cd6
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
209 additions
and
37 deletions
+209
-37
autocomplete_w.py
Lib/idlelib/autocomplete_w.py
+1
-0
config_key.py
Lib/idlelib/config_key.py
+11
-6
configdialog.py
Lib/idlelib/configdialog.py
+1
-0
debugger.py
Lib/idlelib/debugger.py
+1
-0
editor.py
Lib/idlelib/editor.py
+1
-0
help.py
Lib/idlelib/help.py
+11
-11
htest.py
Lib/idlelib/idle_test/htest.py
+2
-1
test_autocomplete.py
Lib/idlelib/idle_test/test_autocomplete.py
+6
-2
test_config_key.py
Lib/idlelib/idle_test/test_config_key.py
+31
-0
test_debugger.py
Lib/idlelib/idle_test/test_debugger.py
+29
-0
test_help.py
Lib/idlelib/idle_test/test_help.py
+34
-0
test_scrolledlist.py
Lib/idlelib/idle_test/test_scrolledlist.py
+29
-0
test_textview.py
Lib/idlelib/idle_test/test_textview.py
+1
-1
test_tree.py
Lib/idlelib/idle_test/test_tree.py
+36
-0
scrolledlist.py
Lib/idlelib/scrolledlist.py
+6
-7
textview.py
Lib/idlelib/textview.py
+2
-1
tree.py
Lib/idlelib/tree.py
+7
-8
No files found.
Lib/idlelib/autocomplete_w.py
Dosyayı görüntüle @
01e35754
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
An auto-completion window for IDLE, used by the autocomplete extension
An auto-completion window for IDLE, used by the autocomplete extension
"""
"""
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
from
idlelib.multicall
import
MC_SHIFT
from
idlelib.multicall
import
MC_SHIFT
from
idlelib.autocomplete
import
COMPLETE_FILES
,
COMPLETE_ATTRIBUTES
from
idlelib.autocomplete
import
COMPLETE_FILES
,
COMPLETE_ATTRIBUTES
...
...
Lib/idlelib/config_key.py
Dosyayı görüntüle @
01e35754
...
@@ -2,31 +2,35 @@
...
@@ -2,31 +2,35 @@
Dialog for building Tkinter accelerator key bindings
Dialog for building Tkinter accelerator key bindings
"""
"""
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.messagebox
as
tkMessageBox
import
string
import
string
import
sys
import
sys
class
GetKeysDialog
(
Toplevel
):
class
GetKeysDialog
(
Toplevel
):
def
__init__
(
self
,
parent
,
title
,
action
,
currentKeySequences
,
_htest
=
False
):
def
__init__
(
self
,
parent
,
title
,
action
,
currentKeySequences
,
_htest
=
False
,
_utest
=
False
):
"""
"""
action - string, the name of the virtual event these keys will be
action - string, the name of the virtual event these keys will be
mapped to
mapped to
currentKeys - list, a list of all key sequence lists currently mapped
currentKeys - list, a list of all key sequence lists currently mapped
to virtual events, for overlap checking
to virtual events, for overlap checking
_utest - bool, do not wait when running unittest
_htest - bool, change box location when running htest
_htest - bool, change box location when running htest
"""
"""
Toplevel
.
__init__
(
self
,
parent
)
Toplevel
.
__init__
(
self
,
parent
)
self
.
withdraw
()
#hide while setting geometry
self
.
configure
(
borderwidth
=
5
)
self
.
configure
(
borderwidth
=
5
)
self
.
resizable
(
height
=
FALSE
,
width
=
FALSE
)
self
.
resizable
(
height
=
FALSE
,
width
=
FALSE
)
self
.
title
(
title
)
self
.
title
(
title
)
self
.
transient
(
parent
)
self
.
transient
(
parent
)
self
.
grab_set
()
self
.
grab_set
()
self
.
protocol
(
"WM_DELETE_WINDOW"
,
self
.
Cancel
)
self
.
protocol
(
"WM_DELETE_WINDOW"
,
self
.
Cancel
)
self
.
parent
=
parent
self
.
parent
=
parent
self
.
action
=
action
self
.
action
=
action
self
.
currentKeySequences
=
currentKeySequences
self
.
currentKeySequences
=
currentKeySequences
self
.
result
=
''
self
.
result
=
''
self
.
keyString
=
StringVar
(
self
)
self
.
keyString
=
StringVar
(
self
)
self
.
keyString
.
set
(
''
)
self
.
keyString
.
set
(
''
)
self
.
SetModifiersForPlatform
()
# set self.modifiers, self.modifier_label
self
.
SetModifiersForPlatform
()
# set self.modifiers, self.modifier_label
self
.
modifier_vars
=
[]
self
.
modifier_vars
=
[]
...
@@ -37,7 +41,6 @@ class GetKeysDialog(Toplevel):
...
@@ -37,7 +41,6 @@ class GetKeysDialog(Toplevel):
self
.
advanced
=
False
self
.
advanced
=
False
self
.
CreateWidgets
()
self
.
CreateWidgets
()
self
.
LoadFinalKeyList
()
self
.
LoadFinalKeyList
()
self
.
withdraw
()
#hide while setting geometry
self
.
update_idletasks
()
self
.
update_idletasks
()
self
.
geometry
(
self
.
geometry
(
"+
%
d+
%
d"
%
(
"+
%
d+
%
d"
%
(
...
@@ -47,6 +50,7 @@ class GetKeysDialog(Toplevel):
...
@@ -47,6 +50,7 @@ class GetKeysDialog(Toplevel):
((
parent
.
winfo_height
()
/
2
-
self
.
winfo_reqheight
()
/
2
)
((
parent
.
winfo_height
()
/
2
-
self
.
winfo_reqheight
()
/
2
)
if
not
_htest
else
150
)
if
not
_htest
else
150
)
)
)
#centre dialog over parent (or below htest box)
)
)
#centre dialog over parent (or below htest box)
if
not
_utest
:
self
.
deiconify
()
#geometry set, unhide
self
.
deiconify
()
#geometry set, unhide
self
.
wait_window
()
self
.
wait_window
()
...
@@ -261,6 +265,7 @@ class GetKeysDialog(Toplevel):
...
@@ -261,6 +265,7 @@ class GetKeysDialog(Toplevel):
keysOK
=
True
keysOK
=
True
return
keysOK
return
keysOK
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
from
idlelib.idle_test.htest
import
run
from
idlelib.idle_test.htest
import
run
run
(
GetKeysDialog
)
run
(
GetKeysDialog
)
Lib/idlelib/configdialog.py
Dosyayı görüntüle @
01e35754
...
@@ -10,6 +10,7 @@ Refer to comments in EditorWindow autoindent code for details.
...
@@ -10,6 +10,7 @@ Refer to comments in EditorWindow autoindent code for details.
"""
"""
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.colorchooser
as
tkColorChooser
import
tkinter.colorchooser
as
tkColorChooser
import
tkinter.font
as
tkFont
import
tkinter.font
as
tkFont
...
...
Lib/idlelib/debugger.py
Dosyayı görüntüle @
01e35754
import
os
import
os
import
bdb
import
bdb
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
from
idlelib.windows
import
ListedToplevel
from
idlelib.windows
import
ListedToplevel
from
idlelib.scrolledlist
import
ScrolledList
from
idlelib.scrolledlist
import
ScrolledList
from
idlelib
import
macosx
from
idlelib
import
macosx
...
...
Lib/idlelib/editor.py
Dosyayı görüntüle @
01e35754
...
@@ -7,6 +7,7 @@ import re
...
@@ -7,6 +7,7 @@ import re
import
string
import
string
import
sys
import
sys
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
import
tkinter.simpledialog
as
tkSimpleDialog
import
tkinter.simpledialog
as
tkSimpleDialog
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.messagebox
as
tkMessageBox
import
traceback
import
traceback
...
...
Lib/idlelib/help.py
Dosyayı görüntüle @
01e35754
...
@@ -26,14 +26,11 @@ show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog.
...
@@ -26,14 +26,11 @@ show_idlehelp - Create HelpWindow. Called in EditorWindow.help_dialog.
"""
"""
from
html.parser
import
HTMLParser
from
html.parser
import
HTMLParser
from
os.path
import
abspath
,
dirname
,
isfile
,
join
from
os.path
import
abspath
,
dirname
,
isfile
,
join
from
tkinter
import
Toplevel
,
Frame
,
Text
,
Scrollbar
,
Menu
,
Menubutton
from
tkinter
import
Toplevel
,
Frame
,
Text
,
Menu
from
tkinter.ttk
import
Menubutton
,
Scrollbar
from
tkinter
import
font
as
tkfont
from
tkinter
import
font
as
tkfont
from
idlelib.config
import
idleConf
from
idlelib.config
import
idleConf
use_ttk
=
False
# until available to import
if
use_ttk
:
from
tkinter.ttk
import
Menubutton
## About IDLE ##
## About IDLE ##
...
@@ -196,15 +193,18 @@ class HelpFrame(Frame):
...
@@ -196,15 +193,18 @@ class HelpFrame(Frame):
"Display html text, scrollbar, and toc."
"Display html text, scrollbar, and toc."
def
__init__
(
self
,
parent
,
filename
):
def
__init__
(
self
,
parent
,
filename
):
Frame
.
__init__
(
self
,
parent
)
Frame
.
__init__
(
self
,
parent
)
text
=
HelpText
(
self
,
filename
)
# keep references to widgets for test access.
self
.
text
=
text
=
HelpText
(
self
,
filename
)
self
[
'background'
]
=
text
[
'background'
]
self
[
'background'
]
=
text
[
'background'
]
scroll
=
Scrollbar
(
self
,
command
=
text
.
yview
)
self
.
toc
=
toc
=
self
.
toc_menu
(
text
)
self
.
scroll
=
scroll
=
Scrollbar
(
self
,
command
=
text
.
yview
)
text
[
'yscrollcommand'
]
=
scroll
.
set
text
[
'yscrollcommand'
]
=
scroll
.
set
self
.
rowconfigure
(
0
,
weight
=
1
)
self
.
rowconfigure
(
0
,
weight
=
1
)
self
.
columnconfigure
(
1
,
weight
=
1
)
# text
self
.
columnconfigure
(
1
,
weight
=
1
)
# text
self
.
toc_menu
(
text
)
.
grid
(
column
=
0
,
row
=
0
,
sticky
=
'nw'
)
toc
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
'nw'
)
text
.
grid
(
column
=
1
,
row
=
0
,
sticky
=
'nsew'
)
text
.
grid
(
row
=
0
,
column
=
1
,
sticky
=
'nsew'
)
scroll
.
grid
(
column
=
2
,
row
=
0
,
sticky
=
'ns'
)
scroll
.
grid
(
row
=
0
,
column
=
2
,
sticky
=
'ns'
)
def
toc_menu
(
self
,
text
):
def
toc_menu
(
self
,
text
):
"Create table of contents as drop-down menu."
"Create table of contents as drop-down menu."
...
@@ -265,7 +265,7 @@ def show_idlehelp(parent):
...
@@ -265,7 +265,7 @@ def show_idlehelp(parent):
if
not
isfile
(
filename
):
if
not
isfile
(
filename
):
# try copy_strip, present message
# try copy_strip, present message
return
return
HelpWindow
(
parent
,
filename
,
'IDLE Help'
)
return
HelpWindow
(
parent
,
filename
,
'IDLE Help'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
from
idlelib.idle_test.htest
import
run
from
idlelib.idle_test.htest
import
run
...
...
Lib/idlelib/idle_test/htest.py
Dosyayı görüntüle @
01e35754
...
@@ -68,6 +68,7 @@ outwin.OutputWindow (indirectly being tested with grep test)
...
@@ -68,6 +68,7 @@ outwin.OutputWindow (indirectly being tested with grep test)
from
importlib
import
import_module
from
importlib
import
import_module
from
idlelib.macosx
import
_init_tk_type
from
idlelib.macosx
import
_init_tk_type
import
tkinter
as
tk
import
tkinter
as
tk
from
tkinter.ttk
import
Scrollbar
AboutDialog_spec
=
{
AboutDialog_spec
=
{
'file'
:
'help_about'
,
'file'
:
'help_about'
,
...
@@ -344,7 +345,7 @@ def run(*tests):
...
@@ -344,7 +345,7 @@ def run(*tests):
frameLabel
.
pack
()
frameLabel
.
pack
()
text
=
tk
.
Text
(
frameLabel
,
wrap
=
'word'
)
text
=
tk
.
Text
(
frameLabel
,
wrap
=
'word'
)
text
.
configure
(
bg
=
root
.
cget
(
'bg'
),
relief
=
'flat'
,
height
=
4
,
width
=
70
)
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
)
text
.
config
(
yscrollcommand
=
scrollbar
.
set
)
scrollbar
.
pack
(
side
=
'right'
,
fill
=
'y'
,
expand
=
False
)
scrollbar
.
pack
(
side
=
'right'
,
fill
=
'y'
,
expand
=
False
)
text
.
pack
(
side
=
'left'
,
fill
=
'both'
,
expand
=
True
)
text
.
pack
(
side
=
'left'
,
fill
=
'both'
,
expand
=
True
)
...
...
Lib/idlelib/idle_test/test_autocomplete.py
Dosyayı görüntüle @
01e35754
''' Test autocomplete and autocomple_w
Coverage of autocomple: 56
%
'''
import
unittest
import
unittest
from
test.support
import
requires
from
test.support
import
requires
from
tkinter
import
Tk
,
Text
from
tkinter
import
Tk
,
Text
import
idlelib.autocomplete
as
ac
import
idlelib.autocomplete
as
ac
import
idlelib.autocomplete_w
as
acw
import
idlelib.autocomplete_w
as
acw
import
idlelib.macosx
as
mac
from
idlelib
import
macosx
from
idlelib.idle_test.mock_idle
import
Func
from
idlelib.idle_test.mock_idle
import
Func
from
idlelib.idle_test.mock_tk
import
Event
from
idlelib.idle_test.mock_tk
import
Event
...
@@ -27,7 +31,7 @@ class AutoCompleteTest(unittest.TestCase):
...
@@ -27,7 +31,7 @@ class AutoCompleteTest(unittest.TestCase):
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
requires
(
'gui'
)
requires
(
'gui'
)
cls
.
root
=
Tk
()
cls
.
root
=
Tk
()
mac
.
setupApp
(
cls
.
root
,
None
)
mac
osx
.
setupApp
(
cls
.
root
,
None
)
cls
.
text
=
Text
(
cls
.
root
)
cls
.
text
=
Text
(
cls
.
root
)
cls
.
editor
=
DummyEditwin
(
cls
.
root
,
cls
.
text
)
cls
.
editor
=
DummyEditwin
(
cls
.
root
,
cls
.
text
)
...
...
Lib/idlelib/idle_test/test_config_key.py
0 → 100644
Dosyayı görüntüle @
01e35754
''' Test idlelib.config_key.
Coverage: 56
%
'''
from
idlelib
import
config_key
from
test.support
import
requires
requires
(
'gui'
)
import
unittest
from
tkinter
import
Tk
,
Text
class
GetKeysTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
cls
.
root
=
Tk
()
@classmethod
def
tearDownClass
(
cls
):
cls
.
root
.
destroy
()
del
cls
.
root
def
test_init
(
self
):
dia
=
config_key
.
GetKeysDialog
(
self
.
root
,
'test'
,
'<<Test>>'
,
[
'<Key-F12>'
],
_utest
=
True
)
dia
.
Cancel
()
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/idle_test/test_debugger.py
0 → 100644
Dosyayı görüntüle @
01e35754
''' Test idlelib.debugger.
Coverage: 19
%
'''
from
idlelib
import
debugger
from
test.support
import
requires
requires
(
'gui'
)
import
unittest
from
tkinter
import
Tk
class
NameSpaceTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
cls
.
root
=
Tk
()
cls
.
root
.
withdraw
()
@classmethod
def
tearDownClass
(
cls
):
cls
.
root
.
destroy
()
del
cls
.
root
def
test_init
(
self
):
debugger
.
NamespaceViewer
(
self
.
root
,
'Test'
)
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/idle_test/test_help.py
0 → 100644
Dosyayı görüntüle @
01e35754
'''Test idlelib.help.
Coverage: 87
%
'''
from
idlelib
import
help
from
test.support
import
requires
requires
(
'gui'
)
from
os.path
import
abspath
,
dirname
,
join
from
tkinter
import
Tk
import
unittest
class
HelpFrameTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
"By itself, this tests that file parsed without exception."
cls
.
root
=
root
=
Tk
()
root
.
withdraw
()
helpfile
=
join
(
abspath
(
dirname
(
dirname
(
__file__
))),
'help.html'
)
cls
.
frame
=
help
.
HelpFrame
(
root
,
helpfile
)
@classmethod
def
tearDownClass
(
cls
):
del
cls
.
frame
cls
.
root
.
update_idletasks
()
cls
.
root
.
destroy
()
del
cls
.
root
def
test_line1
(
self
):
text
=
self
.
frame
.
text
self
.
assertEqual
(
text
.
get
(
'1.0'
,
'1.end'
),
' IDLE '
)
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/idle_test/test_scrolledlist.py
0 → 100644
Dosyayı görüntüle @
01e35754
''' Test idlelib.scrolledlist.
Coverage: 39
%
'''
from
idlelib
import
scrolledlist
from
test.support
import
requires
requires
(
'gui'
)
import
unittest
from
tkinter
import
Tk
class
ScrolledListTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
cls
.
root
=
Tk
()
@classmethod
def
tearDownClass
(
cls
):
cls
.
root
.
destroy
()
del
cls
.
root
def
test_init
(
self
):
scrolledlist
.
ScrolledList
(
self
.
root
)
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/idle_test/test_textview.py
Dosyayı görüntüle @
01e35754
...
@@ -7,13 +7,13 @@ information about calls.
...
@@ -7,13 +7,13 @@ information about calls.
The coverage is essentially 100
%
.
The coverage is essentially 100
%
.
'''
'''
from
idlelib
import
textview
as
tv
from
test.support
import
requires
from
test.support
import
requires
requires
(
'gui'
)
requires
(
'gui'
)
import
unittest
import
unittest
import
os
import
os
from
tkinter
import
Tk
from
tkinter
import
Tk
from
idlelib
import
textview
as
tv
from
idlelib.idle_test.mock_idle
import
Func
from
idlelib.idle_test.mock_idle
import
Func
from
idlelib.idle_test.mock_tk
import
Mbox
from
idlelib.idle_test.mock_tk
import
Mbox
...
...
Lib/idlelib/idle_test/test_tree.py
0 → 100644
Dosyayı görüntüle @
01e35754
''' Test idlelib.tree.
Coverage: 56
%
'''
from
idlelib
import
tree
from
test.support
import
requires
requires
(
'gui'
)
import
os
import
unittest
from
tkinter
import
Tk
class
TreeTest
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
):
cls
.
root
=
Tk
()
cls
.
root
.
withdraw
()
@classmethod
def
tearDownClass
(
cls
):
cls
.
root
.
destroy
()
del
cls
.
root
def
test_init
(
self
):
# Start with code slightly adapted from htest.
sc
=
tree
.
ScrolledCanvas
(
self
.
root
,
bg
=
"white"
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
,
side
=
'left'
)
item
=
tree
.
FileTreeItem
(
tree
.
ICONDIR
)
node
=
tree
.
TreeNode
(
sc
.
canvas
,
None
,
item
)
node
.
expand
()
if
__name__
==
'__main__'
:
unittest
.
main
(
verbosity
=
2
)
Lib/idlelib/scrolledlist.py
Dosyayı görüntüle @
01e35754
from
tkinter
import
*
from
tkinter
import
*
from
idlelib
import
macosx
from
idlelib
import
macosx
from
tkinter.ttk
import
Scrollbar
class
ScrolledList
:
class
ScrolledList
:
...
@@ -124,22 +125,20 @@ class ScrolledList:
...
@@ -124,22 +125,20 @@ class ScrolledList:
pass
pass
def
_scrolled_list
(
parent
):
def
_scrolled_list
(
parent
):
# htest #
root
=
Tk
()
top
=
Toplevel
(
parent
)
root
.
title
(
"Test ScrolledList"
)
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
top
.
geometry
(
"+
%
d+
%
d"
%
(
x
+
200
,
y
+
175
))
class
MyScrolledList
(
ScrolledList
):
class
MyScrolledList
(
ScrolledList
):
def
fill_menu
(
self
):
self
.
menu
.
add_command
(
label
=
"right click"
)
def
fill_menu
(
self
):
self
.
menu
.
add_command
(
label
=
"right click"
)
def
on_select
(
self
,
index
):
print
(
"select"
,
self
.
get
(
index
))
def
on_select
(
self
,
index
):
print
(
"select"
,
self
.
get
(
index
))
def
on_double
(
self
,
index
):
print
(
"double"
,
self
.
get
(
index
))
def
on_double
(
self
,
index
):
print
(
"double"
,
self
.
get
(
index
))
scrolled_list
=
MyScrolledList
(
root
)
scrolled_list
=
MyScrolledList
(
top
)
for
i
in
range
(
30
):
for
i
in
range
(
30
):
scrolled_list
.
append
(
"Item
%02
d"
%
i
)
scrolled_list
.
append
(
"Item
%02
d"
%
i
)
root
.
mainloop
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
# At the moment, test_scrolledlist merely creates instance, like htest.
from
idlelib.idle_test.htest
import
run
from
idlelib.idle_test.htest
import
run
run
(
_scrolled_list
)
run
(
_scrolled_list
)
Lib/idlelib/textview.py
Dosyayı görüntüle @
01e35754
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
"""
"""
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
import
tkinter.messagebox
as
tkMessageBox
import
tkinter.messagebox
as
tkMessageBox
class
TextViewer
(
Toplevel
):
class
TextViewer
(
Toplevel
):
...
@@ -50,7 +51,7 @@ class TextViewer(Toplevel):
...
@@ -50,7 +51,7 @@ class TextViewer(Toplevel):
self
.
buttonOk
=
Button
(
frameButtons
,
text
=
'Close'
,
self
.
buttonOk
=
Button
(
frameButtons
,
text
=
'Close'
,
command
=
self
.
Ok
,
takefocus
=
FALSE
)
command
=
self
.
Ok
,
takefocus
=
FALSE
)
self
.
scrollbarView
=
Scrollbar
(
frameText
,
orient
=
VERTICAL
,
self
.
scrollbarView
=
Scrollbar
(
frameText
,
orient
=
VERTICAL
,
takefocus
=
FALSE
,
highlightthickness
=
0
)
takefocus
=
FALSE
)
self
.
textView
=
Text
(
frameText
,
wrap
=
WORD
,
highlightthickness
=
0
,
self
.
textView
=
Text
(
frameText
,
wrap
=
WORD
,
highlightthickness
=
0
,
fg
=
self
.
fg
,
bg
=
self
.
bg
)
fg
=
self
.
fg
,
bg
=
self
.
bg
)
self
.
scrollbarView
.
config
(
command
=
self
.
textView
.
yview
)
self
.
scrollbarView
.
config
(
command
=
self
.
textView
.
yview
)
...
...
Lib/idlelib/tree.py
Dosyayı görüntüle @
01e35754
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
os
import
os
from
tkinter
import
*
from
tkinter
import
*
from
tkinter.ttk
import
Scrollbar
from
idlelib
import
zoomheight
from
idlelib
import
zoomheight
from
idlelib.config
import
idleConf
from
idlelib.config
import
idleConf
...
@@ -449,18 +449,17 @@ class ScrolledCanvas:
...
@@ -449,18 +449,17 @@ class ScrolledCanvas:
return
"break"
return
"break"
def
_tree_widget
(
parent
):
def
_tree_widget
(
parent
):
# htest #
root
=
Tk
()
top
=
Toplevel
(
parent
)
root
.
title
(
"Test TreeWidget"
)
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
top
.
geometry
(
"+
%
d+
%
d"
%
(
x
+
50
,
y
+
175
))
sc
=
ScrolledCanvas
(
root
,
bg
=
"white"
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
=
ScrolledCanvas
(
top
,
bg
=
"white"
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
,
side
=
LEFT
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
,
side
=
LEFT
)
item
=
FileTreeItem
(
os
.
getcwd
()
)
item
=
FileTreeItem
(
ICONDIR
)
node
=
TreeNode
(
sc
.
canvas
,
None
,
item
)
node
=
TreeNode
(
sc
.
canvas
,
None
,
item
)
node
.
expand
()
node
.
expand
()
root
.
mainloop
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
# test_tree is currently a copy of this
from
idlelib.idle_test.htest
import
run
from
idlelib.idle_test.htest
import
run
run
(
_tree_widget
)
run
(
_tree_widget
)
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