Tkinter菜单窗口

2024-10-01 17:25:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Tkinter创建一个菜单。创建菜单后,我希望能够更改单选按钮的标签。类似于.configure方法。我该怎么做?在

我希望能够将单选按钮文本从“Hello”更改为“Hello!”。在

代码段:

    self.B3Me = Tkinter.Menu(self, tearoff=0,
                                activebackground='grey15',
                                activeforeground='grey95')
    self.B3MeVar = Tkinter.StringVar()
    self.B3Me.add_radiobutton(label='Hello', variable=self.B3MeVar,
                                 command=self.B3_menu_beh)

Tags: 方法文本selfhellotkinterconfigure代码段菜单

热门问题