I am in a middle of a complex thing. Look:
frame = tk.Frame(root)
frame.pack()
TabTool = tk.Frame(root)
TabTool.pack(side = tk.TOP)
Bottom = tk.Frame(root)
Bottom.pack(side = tk.BOTTOM)
def Label(Frame, Name, Text):
Name = tk.Label(Frame, text = Text)
Name.pack(side = tk.LEFT)
def Button(Frame, Name, Text, Image, Command, Pack):
Name = tk.Button(Frame, text = Text, image = Image, command = Command)
Name.pack(side = Pack)
Label(Bottom ,'lab','Welcome!')
Button(Bottom ,'a' , 'NUT', None, quit ,tk.LEFT)
CanvasArea = ttk.Frame(Bottom)
CanvasArea.pack(side = tk.LEFT)
CW = 300
CH = 600
LXM = (CW / 2)
LYM = (CH / 2)
R = 'red'
G = 'green'
B = 'blue'
JB = 'black'
MainCanvas = tk.Canvas(CanvasArea, bg = 'white', height = CH, width = CW)
MainCanvas.pack(side = tk.LEFT)
def Ch1(LX, LY, SX, SY):
NP = (((-1 * SX) + LX), ((0 * SY) + LY), ((1 * SX) + LX), ((0 * SY) + LY))
A1 = (((10 * SX) + LX), ((0 * SY) + LY), ((10 * SX) + LX), ((0 * SY) + LY)), ((10 * SX) + LX), ((-10 * SY) + LY))
A2 = (((-10 * SX) + LX), ((0 * SY) + LY), ((-10 * SX) + LX), ((0 * SY) + LY)), ((10 * SX) + LX), ((10 * SY) + LY))
def CB(M1, M2, M3, MC1, MC2, MC3, LO, LT, LS):
MainCanvas.create_polygon(M1, fill = MC1, outline = LO, width = LT, smooth = LS)
MainCanvas.create_polygon(M2, fill = MC2, outline = LO, width = LT, smooth = LS)
MainCanvas.create_polygon(M3, fill = MC3, outline = LO, width = LT, smooth = LS)
def Type(T1, T2, T3, C1, C2, C3, LO, LT, LS):
CB(T1, T2, T3, C1, C2, C3, LO, LT, LS)
CB(T1, T3, NP, C3, C2, C1, LO, LT, LS)
Type(A1, A2, NP, R, G, B, JB, 1, 0)
Ch1(LXM, LYM, 1, 1)
The question is how to switch the variables in the arguments in the “Type” function call, by inputting variables in the additional arguments in the Ch1 (e.g. type A1 into an argument in Ch1 to have the T1 argument input switch to A1 (from the Ch1 argument input)). I cannot just separate the variables into other things, because things like LX, LY, SX, SY need to be defined by arguments to work. Any ideas on what to do? I am running out of options.