我有一个单选按钮的对齐问题。我想要三列表单元素。由于某些原因,当我在表单中添加单选按钮时,它们似乎会占用左边新列的空间。我希望有一个简单的网格布局,每个单元格都有相同的大小。看来情况并非如此。如有任何建议,我们将不胜感激!在
以下是我的部分代码:
self._mode_state = StringVar()
self._mode_radio_timelapse = Radiobutton(self, text="Timelapse", command=self._transition(), value=self._timelapse_mode, variable=self._mode_state)
self._mode_radio_continuous = Radiobutton(self, text="Continuous", command=self._transition(), value=self._continuous_mode, variable=self._mode_state)
self._mode_radio_ramphold = Radiobutton(self, text="Ramp and Hold", command=self._transition(), value=self._ramp_hold_mode, variable=self._mode_state)
self._mode_radio_timelapse.grid(row=0, column=0, pady=10)
self._mode_radio_continuous.grid(row=0, column=1, pady=10)
self._mode_radio_ramphold.grid(row=0, column=2, pady=10)
image_set_label = Label(text="Image Set Type: ")
image_set_label.grid(row=1, column=0, pady=10)
self._image_set_type = Entry()
self._image_set_type.insert(0, "Ramp")
self._image_set_type.grid(row=1, column=1, pady=10, columnspan=2)
这些小部件并不都在同一个网格上。单选按钮是用}小部件不是用任何父对象创建的,因此父对象默认为根对象。在
self
的父对象设置的,但是您的Label
和{解决方法如下:
相关问题 更多 >
编程相关推荐