当前位置: 首页 > 面试题库 >

所有Tkinter活动列表

景鹏飞
2023-03-14
问题内容

在Pythontkinter模块中<Button-1><Button-2><Button-3>用于分别标识左,中和右按钮的鼠标单击。

同样,<KeyPress-Return>用于返回键的按下。

在哪里可以找到所有此类事件的列表,包括各种键盘键的名称?

Tcl绑定手册没有那些。


问题答案:

可以在effbot.org或New Mexico
Tech提供
的文档中找到有关绑定和事件的常规列表,而此处除了原始文档之外,还列出了几个键的名称。

以下是最常见事件的摘要,并解释了一些按键名称:

<Button-1>        Button 1 is the leftmost button, button 2 is the middle button
                  (where available), and button 3 the rightmost button.

                  <Button-1>, <ButtonPress-1>, and <1> are all synonyms.

                  For mouse wheel support under Linux, use Button-4 (scroll
                  up) and Button-5 (scroll down)

<B1-Motion>       The mouse is moved, with mouse button 1 being held down (use
                  B2 for the middle button, B3 for the right button).

<ButtonRelease-1> Button 1 was released. This is probably a better choice in
                  most cases than the Button event, because if the user
                  accidentally presses the button, they can move the mouse
                  off the widget to avoid setting off the event.

<Double-Button-1> Button 1 was double clicked. You can use Double or Triple as
                  prefixes.

<Enter>           The mouse pointer entered the widget (this event doesn’t mean
                  that the user pressed the Enter key!).

<Leave>           The mouse pointer left the widget.

<FocusIn>         Keyboard focus was moved to this widget, or to a child of
                  this widget.

<FocusOut>        Keyboard focus was moved from this widget to another widget.

<Return>          The user pressed the Enter key. For an ordinary 102-key
                  PC-style keyboard, the special keys are Cancel (the Break
                  key), BackSpace, Tab, Return(the Enter key), Shift_L (any
                  Shift key), Control_L (any Control key), Alt_L (any Alt key),
                  Pause, Caps_Lock, Escape, Prior (Page Up), Next (Page Down),
                  End, Home, Left, Up, Right, Down, Print, Insert, Delete, F1,
                  F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Num_Lock, and
                  Scroll_Lock.

<Key>             The user pressed any key. The key is provided in the char
                  member of the event object passed to the callback (this is an
                  empty string for special keys).

a                 The user typed an “a”. Most printable characters can be used
                  as is. The exceptions are space (<space>) and less than
                  (<less>). Note that 1 is a keyboard binding, while <1> is a
                  button binding.

<Shift-Up>        The user pressed the Up arrow, while holding the Shift key
                  pressed. You can use prefixes like Alt, Shift, and Control.

<Configure>       The widget changed size (or location, on some platforms). The
                  new size is provided in the width and height attributes of
                  the event object passed to the callback.

<Activate>        A widget is changing from being inactive to being active.
                  This refers to changes in the state option of a widget such
                  as a button changing from inactive (grayed out) to active.


<Deactivate>      A widget is changing from being active to being inactive.
                  This refers to changes in the state option of a widget such
                  as a radiobutton changing from active to inactive (grayed out).

<Destroy>         A widget is being destroyed.

<Expose>          This event occurs whenever at least some part of your
                  application or widget becomes visible after having been
                  covered up by another window.

<KeyRelease>      The user let up on a key.

<Map>             A widget is being mapped, that is, made visible in the
                  application. This will happen, for example, when you call the
                  widget's .grid() method.

<Motion>          The user moved the mouse pointer entirely within a widget.

<MouseWheel>      The user moved the mouse wheel up or down. At present, this
                  binding works on Windows and MacOS, but not under Linux.

<Unmap>           A widget is being unmapped and is no longer visible.

<Visibility>      Happens when at least some part of the application window
                  becomes visible on the screen.


 类似资料:
  • 我刚刚将一个应用程序重构为一个框架库和一个应用程序,但现在当我尝试在模拟器中启动该应用程序时,我得到了以下错误堆栈跟踪: 通常这意味着清单文件在某些方面是错误的,但我已经仔细检查了我能想到的一切。 这是我的活动课: null

  • 前提条件: AndroidQ 问题一: 我在前台有一个视图,当用户单击该视图时,我尝试在android Q中启动一个活动。 以下是我的代码。 它不工作,也不会发生碰撞。我有一些日志。 D ActivityTaskManagerServiceInjector: MIUILOG-权限拒绝活动:意图... 问题2: 我有一个TileService,当用户单击状态栏中的图标时,我尝试启动一个活动 雄激素单

  • 我是Azure服务总线的新手,我应该将消息推送到队列中,然后有一个单独的计划任务,该任务将读取该队列中的所有活动消息,并将它们批量导入到sql我以前尝试过这个代码,当我调用时它正在工作它在发送消息后立即工作,但现在它在单独的计划任务中不工作。任何帮助为什么或什么我可以用来批量阅读信息或这是不可能的

  • 问题内容: 我有一个问题,提交表单时所有活动的ajax请求均失败,并触发错误事件。 如何在不触发错误事件的情况下停止jQuery中所有活动的ajax请求? 问题答案: 每次创建ajax请求时,都可以使用变量来存储它: 然后,您可以中止请求: 您可以使用数组来跟踪所有未决的ajax请求,并在必要时中止它们。