why font size is not increasing although i have clearly mentioned it in my following code please someone check tell me the problem. whenever i my code and select on text size and click on some number like 8 0r 9 or any other number font size should also change according to number like in small number font size should be small and in big number font size should be big but font size is not changing.
from tkinter import *
import tkinter.font as font
root = Tk()
root.title("MyCodeEditor")
def run():
code = editor.get('1.0',END)
exec(code)
############################ colour theme ######################################################3#
def dark():
editor.config(background = "black" , foreground = "white",insertbackground = "white")
root.config(background = "black")
def light():
editor.config(background = "white" , foreground = "black" , insertbackground = "black" )
root.config(background = "white")
def blue_sky():
editor.config(background = "powder blue", foreground = "black" , insertbackground = "black" )
root.config(background = "powder blue")
####################################### Text style ####################################################33
def terminal_family():
editor.config(font = 'Terminal')
def modern_family():
editor.config(font = ('Modern'))
def roman_family():
editor.config(font = 'Roman')
def default_family():
editor.config(font = 'Calibri')
def system_family():
editor.config(font = 'System')
def aerial_family():
editor.config(font = 'Aerial')
def ms_serif_family ():
editor.config(font = 'MS_Serif')
############################ Text size #################################################################################################
def eight_size():
editor.config(font = 8)
def nine_size():
editor.config(font = 9)
def ten_size():
editor.config(font = 10)
def eleven_size():
editor.config(font = 11)
def twelve_size():
editor.config(font = 12)
def thirteen_size():
editor.config(font = 13)
def fourteen_size():
editor.config(font = 14)
def fifteen_size():
editor.config(font = 15)
def sixteen_size():
editor.config(font = 16)
def seventeen_size():
editor.config(font = 17)
def eighteen_size():
editor.config(font = 18)
def nineteen_size():
editor.config(font = 19)
def twenty_size():
editor.config(font = 20)
def twenty_five_size():
editor.config(font = 25)
def thirty_size():
editor.config(font = 30)
# menu_bar = Menu(root)
####################################### Menu ############################################################
menu_bar = Menu(root)
file_bar = Menu(menu_bar,tearoff = 0)
file_bar.add_command(label = 'Open',command = run )
file_bar.add_command(label = 'Save',command = run )
file_bar.add_command(label = 'Save as',command = run )
file_bar.add_command(label = 'Exit',command = exit )
menu_bar.add_cascade(label='File',menu = file_bar)
root.config(menu = menu_bar)
###########################################################################################################
run_bar = Menu(menu_bar,tearoff = 0)
run_bar.add_command(label = 'Run',command = run )
menu_bar.add_cascade(label='Run',menu = run_bar)
root.config(menu = menu_bar)
##############################################################################################################
colorTheme_bar = Menu(menu_bar,tearoff = 0)
colorTheme_bar.add_command(label = 'Light Mode',command = light )
colorTheme_bar.add_command(label = 'Dark Mode',command = dark )
colorTheme_bar.add_command(label = 'Blue Sky Mode',command = blue_sky )
menu_bar.add_cascade(label='Color Theme',menu = colorTheme_bar)
root.config(menu = menu_bar)
# file_bar = Menu(menu_bar,tearoff = 0)
# file_bar.add_command(label = 'Open',command = run )
# menu_bar.add_cascade(label='File',menu = file_bar)
# root.config(menu = menu_bar)
#####################################################################################################################
fontStyle_bar = Menu(menu_bar,tearoff = 0)
fontStyle_bar.add_command(label = 'Default',command = default_family)
fontStyle_bar.add_command(label = 'Modern',command = modern_family )
fontStyle_bar.add_command(label = 'Roman',command = roman_family )
fontStyle_bar.add_command(label = 'Ms serif',command = ms_serif_family )
fontStyle_bar.add_command(label = 'Aerial',command = aerial_family )
fontStyle_bar.add_command(label = 'System',command = system_family )
fontStyle_bar.add_command(label = 'Terminal',command = terminal_family )
menu_bar.add_cascade(label='Text Style',menu = fontStyle_bar)
root.config(menu = menu_bar)
######################################################################################################################################
textSize_bar = Menu(menu_bar,tearoff = 0)
textSize_bar.add_command(label = 8,command = eight_size )
textSize_bar.add_command(label = 9,command = nine_size )
textSize_bar.add_command(label = 10,command = ten_size )
textSize_bar.add_command(label = 11,command = eleven_size )
textSize_bar.add_command(label = 12,command = twelve_size )
textSize_bar.add_command(label = 13,command = thirteen_size )
textSize_bar.add_command(label = 14,command = fourteen_size )
textSize_bar.add_command(label = 15,command = fifteen_size )
textSize_bar.add_command(label = 16,command = sixteen_size )
textSize_bar.add_command(label = 17,command = seventeen_size )
textSize_bar.add_command(label = 18,command = eighteen_size )
textSize_bar.add_command(label = 19,command = nineteen_size )
textSize_bar.add_command(label = 20,command = twenty_size )
textSize_bar.add_command(label = 25,command = twenty_five_size )
textSize_bar.add_command(label = 30,command = thirty_size )
menu_bar.add_cascade(label='Text Size',menu = textSize_bar)
root.config(menu = menu_bar)
#########################################################################################################
editor = Text()
editor.pack()
root.mainloop()