<bdo id='b4Wla'></bdo><ul id='b4Wla'></ul>

  • <tfoot id='b4Wla'></tfoot>

      <legend id='b4Wla'><style id='b4Wla'><dir id='b4Wla'><q id='b4Wla'></q></dir></style></legend>

      <small id='b4Wla'></small><noframes id='b4Wla'>

      1. <i id='b4Wla'><tr id='b4Wla'><dt id='b4Wla'><q id='b4Wla'><span id='b4Wla'><b id='b4Wla'><form id='b4Wla'><ins id='b4Wla'></ins><ul id='b4Wla'></ul><sub id='b4Wla'></sub></form><legend id='b4Wla'></legend><bdo id='b4Wla'><pre id='b4Wla'><center id='b4Wla'></center></pre></bdo></b><th id='b4Wla'></th></span></q></dt></tr></i><div id='b4Wla'><tfoot id='b4Wla'></tfoot><dl id='b4Wla'><fieldset id='b4Wla'></fieldset></dl></div>

        tkinter 单选按钮在鼠标悬停在它上面时被选中

        tkinter Radiobutton gets selected when the mouse hovers over it(tkinter 单选按钮在鼠标悬停在它上面时被选中)

              <i id='2bwZz'><tr id='2bwZz'><dt id='2bwZz'><q id='2bwZz'><span id='2bwZz'><b id='2bwZz'><form id='2bwZz'><ins id='2bwZz'></ins><ul id='2bwZz'></ul><sub id='2bwZz'></sub></form><legend id='2bwZz'></legend><bdo id='2bwZz'><pre id='2bwZz'><center id='2bwZz'></center></pre></bdo></b><th id='2bwZz'></th></span></q></dt></tr></i><div id='2bwZz'><tfoot id='2bwZz'></tfoot><dl id='2bwZz'><fieldset id='2bwZz'></fieldset></dl></div>

              <small id='2bwZz'></small><noframes id='2bwZz'>

                  <tbody id='2bwZz'></tbody>
                • <bdo id='2bwZz'></bdo><ul id='2bwZz'></ul>

                  <legend id='2bwZz'><style id='2bwZz'><dir id='2bwZz'><q id='2bwZz'></q></dir></style></legend>
                  <tfoot id='2bwZz'></tfoot>
                  本文介绍了tkinter 单选按钮在鼠标悬停在它上面时被选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 tkinter 中使用单选按钮,我可以很好地选择它们,但是当鼠标悬停在其中一个选项上时,它会被选中,而无需我实际单击鼠标左键.我已经研究过将单选按钮的状态更改为禁用,但显然我无法选择禁用的选项,而且我还使用了取消选择和选择方法,它们不会阻止鼠标选择当它悬停在它上面时的选项.有没有办法在我用鼠标点击它之前停止鼠标选择选项?

                  I'm using Radiobuttons in tkinter and I can select them fine but when the mouse hovers over one of the options it gets selected without me actually clicking the left button on the mouse. I've looked at changing the state of the Radiobutton to disabled but obviously then I wouldn't be able to select the option that is disabled and I've also used the deselect and select method and they don't stop the mouse from selecting the option when it's hovering over it. Is there a way to stop the mouse selecting the option before I click it by using my mouse?

                  谢谢

                  代码如下:

                      var1 = IntVar()
                      self.u1r1 = Radiobutton(self, text = 'Passed', value = 1, variable = var1)
                      self.u1r1.grid(row = 0, column = 0, sticky = W)
                      self.u1r2 = Radiobutton(self, text = 'Not Passed', value = 2, variable = var1)
                      self.u1r2.grid(row = 0, column = 0, sticky = W, padx = 60)
                      self.u1r3 = Radiobutton(self, text = 'Waiting', value = 3, variable = var1)
                      self.u1r3.grid(row = 0, column = 0, sticky = W, padx = 145)
                  

                  推荐答案

                  试试把var1改成self.var1,这样变量对象就不会得到垃圾了-收集.

                  Try changing var1 to self.var1, so that the variable object doesn't get garbage-collected.

                  这篇关于tkinter 单选按钮在鼠标悬停在它上面时被选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding config modes to Plotly.Py offline - modebar(将配置模式添加到 Plotly.Py 离线 - 模式栏)
                  Plotly: How to style a plotly figure so that it doesn#39;t display gaps for missing dates?(Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙?)
                  python save plotly plot to local file and insert into html(python将绘图保存到本地文件并插入到html中)
                  Plotly: What color cycle does plotly express follow?(情节:情节表达遵循什么颜色循环?)
                  How to save plotly express plot into a html or static image file?(如何将情节表达图保存到 html 或静态图像文件中?)
                  Plotly: How to make a line plot from a pandas dataframe with a long or wide format?(Plotly:如何使用长格式或宽格式的 pandas 数据框制作线图?)
                • <small id='hEgae'></small><noframes id='hEgae'>

                  <legend id='hEgae'><style id='hEgae'><dir id='hEgae'><q id='hEgae'></q></dir></style></legend>
                    <tfoot id='hEgae'></tfoot>
                    <i id='hEgae'><tr id='hEgae'><dt id='hEgae'><q id='hEgae'><span id='hEgae'><b id='hEgae'><form id='hEgae'><ins id='hEgae'></ins><ul id='hEgae'></ul><sub id='hEgae'></sub></form><legend id='hEgae'></legend><bdo id='hEgae'><pre id='hEgae'><center id='hEgae'></center></pre></bdo></b><th id='hEgae'></th></span></q></dt></tr></i><div id='hEgae'><tfoot id='hEgae'></tfoot><dl id='hEgae'><fieldset id='hEgae'></fieldset></dl></div>
                      • <bdo id='hEgae'></bdo><ul id='hEgae'></ul>
                              <tbody id='hEgae'></tbody>