class Lnput_lnitialization(): def __init__(self, top, Number_of_rows): self.top = top int(data_demo.window_width // 3.9875) int(data_demo.window_height // 1.138) self.frame = tk.Frame(self.top, bg='Black', highlightthickness=2, highlightbackground='Black') self.frame.place(relx=0.739, rely=0.083, width=int(data_demo.window_width // 3.87), height=int(data_demo.window_height // 1.15)) self.canvas = tk.Canvas(self.frame) self.canvas.place(relx=0, rely=0, width=int(data_demo.window_width // 3.9875), height=int(data_demo.window_height // 1.15)) scrollbar = tk.Scrollbar(self.frame, command=self.canvas.yview) scrollbar.pack(side="right", fill="y") self.canvas.configure(yscrollcommand=scrollbar.set) self.button_frame = tk.Frame(self.canvas, bg='Yellow') self.canvas.create_window((0, 0), window=self.button_frame, anchor="nw") self.Content(Number_of_rows) # 在步骤栏创建填写框 def Content(self, Number_of_rows): x = 0.01 y = 0.01 for a in range(Number_of_rows): var = tk.IntVar() checkbutton1 = Checkbutton(self.button_frame, variable=var, text="{}".format(data_demo.Serial_Number), compound='right') checkbutton1.grid(row=data_demo.Serial_Number, column=1, padx=3, pady=5) data_demo.checkbutton1_boxs.append(checkbutton1) data_demo.checkbutton_bool.append(var) combobox1 = ttk.Combobox(self.button_frame, values=["遥控", "语音", "随机"], width=4) combobox1.grid(row=data_demo.Serial_Number, column=2, padx=6, pady=5) data_demo.comboxox_boxs.append(combobox1)怎么让他自适应大小
最新发布