@@ -1848,7 +1848,7 @@ def create_page_font_tab(self):
1848
1848
corresponding aspect of the font sample on this page and
1849
1849
highlight sample on highlight page.
1850
1850
1851
- Load_font_cfg initializes font vars and widgets from
1851
+ Funtion load_font_cfg initializes font vars and widgets from
1852
1852
idleConf entries and tk.
1853
1853
1854
1854
Fontlist: mouse button 1 click or up or down key invoke
@@ -1866,7 +1866,7 @@ def create_page_font_tab(self):
1866
1866
1867
1867
Tabs: Enable users to change spaces entered for indent tabs.
1868
1868
Changing indent_scale value with the mouse sets Var space_num,
1869
- which invokes var_changed_space_num, which adds an entry to
1869
+ which invokes the default callback to add an entry to
1870
1870
changes. Load_tab_cfg initializes space_num to default.
1871
1871
1872
1872
Widget Structure: (*) widgets bound to self
@@ -1887,10 +1887,10 @@ def create_page_font_tab(self):
1887
1887
(*)indent_scale: Scale - space_num
1888
1888
"""
1889
1889
parent = self .parent
1890
- self .font_name = StringVar (parent )
1891
- self .font_size = StringVar (parent )
1892
- self .font_bold = BooleanVar (parent )
1893
- self .space_num = IntVar (parent )
1890
+ self .font_name = tracers . add ( StringVar (parent ), self . var_changed_font )
1891
+ self .font_size = tracers . add ( StringVar (parent ), self . var_changed_font )
1892
+ self .font_bold = tracers . add ( BooleanVar (parent ), self . var_changed_font )
1893
+ self .space_num = tracers . add ( IntVar (parent ), ( 'main' , 'Indent' , 'num-spaces' ) )
1894
1894
1895
1895
# Create widgets:
1896
1896
# body and body section frames.
@@ -1963,7 +1963,7 @@ def load_font_cfg(self):
1963
1963
configured_font = idleConf .GetFont (self .parent , 'main' , 'EditorWindow' )
1964
1964
font_name = configured_font [0 ].lower ()
1965
1965
font_size = configured_font [1 ]
1966
- font_bold = configured_font [2 ]== 'bold'
1966
+ font_bold = configured_font [2 ]== 'bold'
1967
1967
1968
1968
# Set editor font selection list and font_name.
1969
1969
fonts = list (tkFont .families (self .parent ))
@@ -1987,16 +1987,6 @@ def load_font_cfg(self):
1987
1987
# Set font weight.
1988
1988
self .font_bold .set (font_bold )
1989
1989
1990
- def on_fontlist_select (self , event ):
1991
- """Handle selecting a font from the list.
1992
-
1993
- Event can result from either mouse click or Up or Down key.
1994
- Set font_name and example displays to selection.
1995
- """
1996
- font = self .fontlist .get (
1997
- ACTIVE if event .type .name == 'KeyRelease' else ANCHOR )
1998
- self .font_name .set (font .lower ())
1999
-
2000
1990
def var_changed_font (self , * params ):
2001
1991
"""Store changes to font attributes.
2002
1992
@@ -2012,6 +2002,16 @@ def var_changed_font(self, *params):
2012
2002
changes .add_option ('main' , 'EditorWindow' , 'font-bold' , value )
2013
2003
self .set_samples ()
2014
2004
2005
+ def on_fontlist_select (self , event ):
2006
+ """Handle selecting a font from the list.
2007
+
2008
+ Event can result from either mouse click or Up or Down key.
2009
+ Set font_name and example displays to selection.
2010
+ """
2011
+ font = self .fontlist .get (
2012
+ ACTIVE if event .type .name == 'KeyRelease' else ANCHOR )
2013
+ self .font_name .set (font .lower ())
2014
+
2015
2015
def set_samples (self , event = None ):
2016
2016
"""Update update both screen samples with the font settings.
2017
2017
@@ -2036,11 +2036,6 @@ def load_tab_cfg(self):
2036
2036
'main' , 'Indent' , 'num-spaces' , default = 4 , type = 'int' )
2037
2037
self .space_num .set (space_num )
2038
2038
2039
- def var_changed_space_num (self , * params ):
2040
- "Store change to indentation size."
2041
- value = self .space_num .get ()
2042
- changes .add_option ('main' , 'Indent' , 'num-spaces' , value )
2043
-
2044
2039
2045
2040
class VarTrace :
2046
2041
"""Maintain Tk variables trace state."""
0 commit comments