Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #105578
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Key Binding Problem |
| Date | Wed, 23 Mar 2016 20:34:08 -0400 |
| Organization | IISS Elusive Unicorn |
| Lines | 40 |
| Message-ID | <mailman.74.1458780091.2244.python-list@python.org> (permalink) |
| References | <o6ydncSeoNfrnm_LnZ2dnUU7-IfNnZ2d@giganews.com> <mailman.27.1458702187.2244.python-list@python.org> <L6KdnXoY773thm_LnZ2dnUU7-QOdnZ2d@giganews.com> <mailman.31.1458715678.2244.python-list@python.org> <GZ-dnUtlpauMIG_LnZ2dnUU7-S-dnZ2d@giganews.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de n9eSVq8kL/WtpZO/zG655gPot9d34SNSJQ62E4K1lYoA== |
| 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; 'python,': 0.02; 'handler': 0.04; 'method,': 0.07; 'callback': 0.09; 'handlers': 0.09; 'message-id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.13; 'wed,': 0.15; 'argument': 0.15; '","': 0.16; '"."': 0.16; '2016': 0.16; '>on': 0.16; 'did,': 0.16; 'invoked,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'subject:Problem': 0.16; 'wrote:': 0.16; 'passes': 0.18; 'url:home': 0.18; 'load': 0.20; 'meant': 0.22; 'arguments': 0.22; 'class,': 0.22; 'mind.': 0.22; 'pass': 0.22; 'code,': 0.23; '(which': 0.26; 'header:X-Complaints- To:1': 0.26; 'separate': 0.27; 'question': 0.27; 'tend': 0.27; 'function': 0.28; '-0500,': 0.29; 'invoke': 0.29; 'way?': 0.29; 'classes': 0.30; 'post': 0.31; 'class': 0.33; 'file': 0.34; 'previous': 0.34; 'but': 0.36; 'depends': 0.36; 'visual': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'method': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'itself': 0.38; 'anything': 0.38; 'why': 0.39; 'data': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; '(that': 0.63; 'information': 0.63; 'mar': 0.65; 'python-list': 0.66; 'receive': 0.71; 'yourself,': 0.72; 'case?': 0.84; 'dennis': 0.91; 'slipped': 0.91; 'received:108': 0.93 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| X-Gmane-NNTP-Posting-Host | adsl-108-73-117-233.dsl.klmzmi.sbcglobal.net |
| X-Newsreader | Forte Agent 6.00/32.1186 |
| X-No-Archive | YES |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| 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> |
| Xref | csiph.com comp.lang.python:105578 |
Show key headers only | View raw
On Wed, 23 Mar 2016 10:58:09 -0500, Wildman via Python-list
<python-list@python.org> declaimed the following:
>On Wed, 23 Mar 2016 02:47:47 -0400, Terry Reedy wrote:
>
>> def load_image(self, _):
>> # load image file
>>
>> You must pass the bound method, as you did, and not the function itself
>> (which has two parameters).
>
>I meant to ask a followup question in my previous post but
>it slipped my mind.
>
>What is the best thing to do...
>Define all procedures this way, (self. event)?
Not "." but "," -- separate arguments
Anything that is a method in a class object will tend to receive the
object itself as the first argument (commonly called "self" in Python, "me"
in Visual BASIC, "this" in C++). Tk callback functions (I think you were
using Tkinter) likely pass the event data (that is, what triggered the
callback -- a key-in callback passes information about the key that was
pressed).
>Define all event handlers this way?
If they are methods of a Tk class, then likely they need this format...
But for classes you create yourself, it depends on how you intend to invoke
them.
>Define only the event handlers that will be called from
>elsewhere in the code, as in this case?
Uhm... If an event handler is never invoked, why write it?
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-22 21:46 -0500
Re: Key Binding Problem MRAB <python@mrabarnett.plus.com> - 2016-03-23 03:02 +0000
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-22 23:28 -0500
Re: Key Binding Problem Terry Reedy <tjreedy@udel.edu> - 2016-03-23 02:47 -0400
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-23 10:40 -0500
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-23 10:58 -0500
Re: Key Binding Problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-23 20:34 -0400
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-23 21:17 -0500
Re: Key Binding Problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-24 08:06 -0400
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-24 11:19 -0500
Re: Key Binding Problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-24 21:43 -0400
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-24 23:37 -0500
Re: Key Binding Problem Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-03-25 12:50 -0400
Re: Key Binding Problem Terry Reedy <tjreedy@udel.edu> - 2016-03-22 23:52 -0400
Re: Key Binding Problem Wildman <best_lay@yahoo.com> - 2016-03-22 23:30 -0500
csiph-web