77
88
99class TextViewer (Toplevel ):
10- """ A simple text viewer dialog for IDLE
10+ "A simple text viewer dialog for IDLE."
1111
12- """
1312 def __init__ (self , parent , title , text , modal = True , _htest = False ):
1413 """Show the given text in a scrollable window with a 'close' button
1514
@@ -21,11 +20,11 @@ def __init__(self, parent, title, text, modal=True, _htest=False):
2120 """
2221 Toplevel .__init__ (self , parent )
2322 self .configure (borderwidth = 5 )
24- # place dialog below parent if running htest
23+ # Place dialog below parent if running htest.
2524 self .geometry ("=%dx%d+%d+%d" % (750 , 500 ,
2625 parent .winfo_rootx () + 10 ,
2726 parent .winfo_rooty () + (10 if not _htest else 100 )))
28- #elguavas - config placeholders til config stuff completed
27+ # TODO: get fg/bg from theme.
2928 self .bg = '#ffffff'
3029 self .fg = '#000000'
3130
@@ -34,9 +33,9 @@ def __init__(self, parent, title, text, modal=True, _htest=False):
3433 self .protocol ("WM_DELETE_WINDOW" , self .Ok )
3534 self .parent = parent
3635 self .textView .focus_set ()
37- #key bindings for this dialog
38- self .bind ('<Return>' ,self .Ok ) #dismiss dialog
39- self .bind ('<Escape>' ,self .Ok ) #dismiss dialog
36+ # Bind keys for closing this dialog.
37+ self .bind ('<Return>' ,self .Ok )
38+ self .bind ('<Escape>' ,self .Ok )
4039 self .textView .insert (0.0 , text )
4140 self .textView .config (state = DISABLED )
4241
0 commit comments