【发布时间】:2017-05-05 01:38:52
【问题描述】:
tech_radioButton1 = ttk.Radiobutton(selection_frame_1, text="ANT+", variable = self.tech_var, value = 1, command = self.tech_select)
tech_radioButton1.pack(side = 'top')
tech_radioButton2 = ttk.Radiobutton(selection_frame_1, text="Bluetooth", variable = self.tech_var, value = 2, command = self.tech_select)
tech_radioButton2.pack(side = 'top')
tech_radioButton3 = ttk.Radiobutton(selection_frame_1, text="BTLE", variable = self.tech_var, value = 3, command = self.tech_select)
tech_radioButton3.pack(side = 'top')
tech_radioButton4 = ttk.Radiobutton(selection_frame_1, text="WLAN", variable = self.tech_var, value = 4, command = self.tech_select)
tech_radioButton4.pack(side = 'top')
tech_radioButton5 = ttk.Radiobutton(selection_frame_1, text="UNII", variable = self.tech_var, value = 5, command = self.tech_select)
tech_radioButton5.pack(side = 'top')
我的项目中有一组单选按钮的这段代码,当我运行它时它看起来像这样:
我想将它们全部锚定在西边,这样它们的左侧就会垂直对齐。我尝试使用 tk 而不是 ttk(因为 ttk 中没有锚选项)单选按钮并设置锚 = 'w',但它们仍然看起来像这样:
有人可以帮忙吗? TIA
【问题讨论】: