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
231c3c88
Kaydet (Commit)
231c3c88
authored
Haz 11, 2006
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add missing svn:eol-style property to text files.
üst
4f96f1f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
36 deletions
+36
-36
macosxSupport.py
Lib/idlelib/macosxSupport.py
+36
-36
No files found.
Lib/idlelib/macosxSupport.py
Dosyayı görüntüle @
231c3c88
"""
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import
sys
def
runningAsOSXApp
():
""" Returns True iff running from the IDLE.app bundle on OSX """
return
(
sys
.
platform
==
'darwin'
and
'IDLE.app'
in
sys
.
argv
[
0
])
def
addOpenEventSupport
(
root
,
flist
):
"""
This ensures that the application will respont to open AppleEvents, which
makes is feaseable to use IDLE as the default application for python files.
"""
def
doOpenFile
(
*
args
):
for
fn
in
args
:
flist
.
open
(
fn
)
# The command below is a hook in aquatk that is called whenever the app
# receives a file open event. The callback can have multiple arguments,
# one for every file that should be opened.
root
.
createcommand
(
"::tk::mac::OpenDocument"
,
doOpenFile
)
def
hideTkConsole
(
root
):
root
.
tk
.
call
(
'console'
,
'hide'
)
def
setupApp
(
root
,
flist
):
"""
Perform setup for the OSX application bundle.
"""
if
not
runningAsOSXApp
():
return
hideTkConsole
(
root
)
addOpenEventSupport
(
root
,
flist
)
"""
A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application).
"""
import
sys
def
runningAsOSXApp
():
""" Returns True iff running from the IDLE.app bundle on OSX """
return
(
sys
.
platform
==
'darwin'
and
'IDLE.app'
in
sys
.
argv
[
0
])
def
addOpenEventSupport
(
root
,
flist
):
"""
This ensures that the application will respont to open AppleEvents, which
makes is feaseable to use IDLE as the default application for python files.
"""
def
doOpenFile
(
*
args
):
for
fn
in
args
:
flist
.
open
(
fn
)
# The command below is a hook in aquatk that is called whenever the app
# receives a file open event. The callback can have multiple arguments,
# one for every file that should be opened.
root
.
createcommand
(
"::tk::mac::OpenDocument"
,
doOpenFile
)
def
hideTkConsole
(
root
):
root
.
tk
.
call
(
'console'
,
'hide'
)
def
setupApp
(
root
,
flist
):
"""
Perform setup for the OSX application bundle.
"""
if
not
runningAsOSXApp
():
return
hideTkConsole
(
root
)
addOpenEventSupport
(
root
,
flist
)
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