def _scale(self, from_, to, resolution, variable, position, command = None,
kwargs = {}):
if command is None:
command = lambda s: variable.set(round(float(s), 3))
scale = ttk.Scale(self.frame1.sliders, from_ = from_, to = to, variable = variable,
orient = "horizontal", length = 20, command = command,
takefocus = False, **kwargs)
if position == 1:
scale.place(relwidth = 0.35, relx = 0, x = 0, y = 25, anchor = "nw")
elif position == 2:
scale.place(relwidth = 0.35, relx = 0, x = 0, y = 70, anchor = "nw")
elif position == 3:
scale.place(relwidth = 0.35, relx = 0.5, x = 0, y = 25, anchor = "nw")
elif position == 4:
scale.place(relwidth = 0.35, relx = 0.5, x = 0, y = 70, anchor = "nw")
return scale
评论列表
文章目录