【问题标题】:Python 2.7 tkinter - opposite of widget.tk_focusNext().focus()Python 2.7 tkinter - 与 widget.tk_focusNext().focus() 相反
【发布时间】:2019-08-01 13:58:02
【问题描述】:

在 linux 上使用 python 2.7 tkinter 命令 e.widget.tk_focusNext().focus() 可以很好地关注下一个小部件。但是我怎么能做相反的事情呢?我想聚焦前一个小部件,怎么做? 实际代码是这样的:

def select(e):
    if e.keysym=="Down":
        e.widget.tk_focusNext().focus()
    elif e.keysym=="Up":
        pass
[...]
root.bind_all("<Key>",select)

【问题讨论】:

    标签: python python-2.7 tkinter


    【解决方案1】:

    你要找的函数是tk_focusPrev

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-31
      • 2016-11-06
      • 2015-06-09
      • 1970-01-01
      • 2017-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多