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
69428f1f
Kaydet (Commit)
69428f1f
authored
Eyl 07, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
improve fonts; Tk 4.0 aware
üst
bbf81755
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
ManPage.py
Demo/tkinter/guido/ManPage.py
+14
-9
No files found.
Demo/tkinter/guido/ManPage.py
Dosyayı görüntüle @
69428f1f
...
@@ -24,9 +24,9 @@ class EditableManPage(ScrolledText):
...
@@ -24,9 +24,9 @@ class EditableManPage(ScrolledText):
ScrolledText
.
__init__
(
self
,
master
,
cnf
)
ScrolledText
.
__init__
(
self
,
master
,
cnf
)
# Define tags for formatting styles
# Define tags for formatting styles
self
.
tag_config
(
'X'
,
{
'
font'
:
BOLDFONT
})
self
.
tag_config
(
'X'
,
{
'
underline'
:
1
})
self
.
tag_config
(
'!'
,
{
'font'
:
ITALIC
FONT
})
self
.
tag_config
(
'!'
,
{
'font'
:
BOLD
FONT
})
self
.
tag_config
(
'_'
,
{
'
underline'
:
1
})
self
.
tag_config
(
'_'
,
{
'
font'
:
ITALICFONT
})
# Set state to idle
# Set state to idle
self
.
fp
=
None
self
.
fp
=
None
...
@@ -133,6 +133,10 @@ class EditableManPage(ScrolledText):
...
@@ -133,6 +133,10 @@ class EditableManPage(ScrolledText):
return
return
savestate
=
self
[
'state'
]
savestate
=
self
[
'state'
]
self
[
'state'
]
=
'normal'
self
[
'state'
]
=
'normal'
if
TkVersion
>=
4.0
:
self
.
mark_set
(
'insert'
,
'end-1c'
)
else
:
self
.
mark_set
(
'insert'
,
'end'
)
if
self
.
empty
:
if
self
.
empty
:
# One or more previous lines were empty
# One or more previous lines were empty
# -- insert one blank line in the text
# -- insert one blank line in the text
...
@@ -158,13 +162,14 @@ class EditableManPage(ScrolledText):
...
@@ -158,13 +162,14 @@ class EditableManPage(ScrolledText):
# Insert a string at the end, with at most one property (tag)
# Insert a string at the end, with at most one property (tag)
def
_insert_prop
(
self
,
str
,
prop
=
' '
):
def
_insert_prop
(
self
,
str
,
prop
=
' '
):
here
=
self
.
index
(
'end'
)
here
=
self
.
index
(
AtInsert
())
self
.
insert
(
'end'
,
str
)
self
.
insert
(
AtInsert
(),
str
)
tags
=
self
.
tag_names
(
here
)
if
TkVersion
<=
4.0
:
for
tag
in
tags
:
tags
=
self
.
tag_names
(
here
)
self
.
tag_remove
(
tag
,
here
,
'end'
)
for
tag
in
tags
:
self
.
tag_remove
(
tag
,
here
,
AtInsert
())
if
prop
!=
' '
:
if
prop
!=
' '
:
self
.
tag_add
(
prop
,
here
,
'end'
)
self
.
tag_add
(
prop
,
here
,
AtInsert
()
)
# Readonly Man Page class -- disables editing, otherwise the same
# Readonly Man Page class -- disables editing, otherwise the same
class
ReadonlyManPage
(
EditableManPage
):
class
ReadonlyManPage
(
EditableManPage
):
...
...
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