Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64016

Re: Bind event is giving me a bug.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'root': 0.05; '"""': 0.07; 'mouse': 0.07; 'tkinter': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '"enter': 0.16; '3.3,': 0.16; 'buggy': 0.16; 'keypress': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'side.': 0.16; 'tk()': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'command': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'pointer': 0.24; 'visible': 0.24; 'help!': 0.26; 'url:edu': 0.26; 'header:X-Complaints-To:1': 0.27; '(this': 0.29; 'label': 0.30; 'moved': 0.30; "i'm": 0.30; '"",': 0.31; 'run': 0.32; 'text': 0.33; 'problem.': 0.35; 'but': 0.35; 'doing': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'email addr:gmail.com': 0.63; 'name': 0.63; 'different': 0.65; 'url:help': 0.67; '"".': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: Bind event is giving me a bug.
Date Wed, 15 Jan 2014 21:59:05 +0100
Organization None
References <803c85f0-2f0f-4fc9-b043-710a77648546@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p5084b3e3.dip0.t-ipconnect.de
User-Agent KNode/4.7.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5543.1389819558.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1389819558 news.xs4all.nl 2972 [2001:888:2000:d::a6]:56437
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64016

Show key headers only | View raw


eneskristo@gmail.com wrote:

> While working with tkinter in python 3.3, I had the following problem.

> root = Tk()
> label = Label(root, text = "Enter the number of competitors.")
> label.pack(side = TOP)
> entered_text = Entry(root)
> entered_text.pack()
> Button(root, text = "Submit", command = get_text).pack()
> root.bind('<Enter>', get_text)

Quoting http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/event-types.html
"""
Enter    
The user moved the mouse pointer into a visible part of a widget. (This is 
different than the enter key, which is a KeyPress event for a key whose name 
is actually 'return'.)
"""

So I think you want "<Return>", not "<Enter>".

> root.mainloop()
> 
> This is a buggy part of the code. When I run it, instead of doing what it
> should do, it responds to all events BUT enter. I'm not sure if this error
> is on tkinters or my side. Please help!

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bind event is giving me a bug. eneskristo@gmail.com - 2014-01-15 12:16 -0800
  Re: Bind event is giving me a bug. Peter Otten <__peter__@web.de> - 2014-01-15 21:59 +0100
  Re: Bind event is giving me a bug. MRAB <python@mrabarnett.plus.com> - 2014-01-15 21:10 +0000
  Re: Bind event is giving me a bug. eneskristo@gmail.com - 2014-01-15 13:19 -0800
  Re: Bind event is giving me a bug. Peter Otten <__peter__@web.de> - 2014-01-15 22:25 +0100
  Re: Bind event is giving me a bug. Terry Reedy <tjreedy@udel.edu> - 2014-01-15 20:44 -0500

csiph-web