Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #9508
| References | <faec2643-7be7-4c92-80d2-e10592af2c17@v7g2000vbk.googlegroups.com> |
|---|---|
| Date | 2011-07-15 16:17 +1000 |
| Subject | Re: Multiplicity and Asininity in Tkinter Event API |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1045.1310710680.1164.python-list@python.org> (permalink) |
On Fri, Jul 15, 2011 at 8:34 AM, rantingrick <rantingrick@gmail.com> wrote: > <KeyPress> > <KeyRelease> > <MouseClick> > <MouseMotion> > <MouseRelease> > <MouseWheel> > > That's it. Go ahead, try to prove me wrong! > Does MouseClick mean Mouse Button Down, or does it mean Mouse Button Pressed Then Released Within A Short Time Without The Mouse Moving In Between? Both events are needed. Since you have MouseRelease, I am guessing that it's MouseButtonDown (or MousePress, to parallel your KeyPress/KeyRelease). If you only have MouseDown and MouseUp events (or MousePress and MouseRelease, whatever you wish to call them), then users have a lot of trouble implementing CUA-compliant mouse-click handlers. In the spirit of Ook and its predecessor, I propose one single event: InputEvent. It will have a parameter that specifies the key ID or mouse button that triggered the event; 0 means no key/button, and indicates a mouse movement event. It will contain the location of the mouse, and it's up to the program to keep track of the last known mouse location, to detect movement. The beauty of this system is that programmers can build interfaces that involve pointing at an object, holding the four keys D-R-A-G, and moving the mouse to another location and releasing those keys. This is far more intuitive than the classic mouse-button way of dragging objects around, and avoids the age-old debate of whether to drag with the left or right mouse button. Tkinter should provide this facility so that all new programs will be written with this in mind. Chris Angelico
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Multiplicity and Asininity in Tkinter Event API rantingrick <rantingrick@gmail.com> - 2011-07-14 15:34 -0700
Re: Multiplicity and Asininity in Tkinter Event API Chris Angelico <rosuav@gmail.com> - 2011-07-15 16:17 +1000
Re: Multiplicity and Asininity in Tkinter Event API rantingrick <rantingrick@gmail.com> - 2011-07-15 06:54 -0700
Re: Multiplicity and Asininity in Tkinter Event API Chris Angelico <rosuav@gmail.com> - 2011-07-16 00:02 +1000
csiph-web