Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Key Binding Problem Date: Thu, 24 Mar 2016 08:06:28 -0400 Organization: IISS Elusive Unicorn Lines: 36 Message-ID: References: <06adnbnMouHI027LnZ2dnUU7-XednZ2d@giganews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de CAbp6h64zFTnDuYvhlTkmgIxb/j4I9D/Fsu2U1dVlx7A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'mouse': 0.07; 'argument:': 0.09; 'callback': 0.09; 'called.': 0.09; 'event):': 0.09; 'handler.': 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; 'state)': 0.09; 'assume': 0.11; 'def': 0.13; 'wed,': 0.15; 'argument': 0.15; '2016': 0.16; 'coordinates': 0.16; 'framework,': 0.16; 'placeholder': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'structure.': 0.16; 'subject:Problem': 0.16; 'instance,': 0.18; 'url:home': 0.18; 'gui': 0.18; 'arguments': 0.22; 'class,': 0.22; 'referring': 0.22; 'code.': 0.23; 'defined': 0.23; 'second': 0.24; '(which': 0.26; 'header:X-Complaints-To:1': 0.26; '-0500,': 0.29; 'handled': 0.29; "i'd": 0.31; 'guess': 0.31; 'screen': 0.32; 'etc.)': 0.32; 'class': 0.33; 'structure': 0.34; 'text': 0.35; 'instance': 0.35; 'but': 0.36; 'there': 0.36; 'framework': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'method': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'button': 0.38; 'self': 0.38; 'mean': 0.38; 'skip:o 20': 0.38; 'means': 0.39; 'data': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'some': 0.40; 'your': 0.60; 'mar': 0.65; 'elsewhere': 0.66; 'python-list': 0.66; 'receive': 0.71; 'click': 0.76; 'as:': 0.79; 'difference.': 0.84; 'fields,': 0.84; 'dennis': 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:105603 On Wed, 23 Mar 2016 21:17:57 -0500, Wildman via Python-list declaimed the following: > >I was referring to procedures called by a button click as >opposed to a procedure calledd from elsewhere in the code. >I guess there is no difference. I assume that is what you >meant. I'd have to see /how/ it is called. The "button click" is an event handled by the GUI framework, to which you've bound a handler. Such items (which may be attached to resize, menu, text fields, etc.) would need the structure the framework uses... So if a method of a class, that means a first argument placeholder of "self", and most likely a second for some "event" data structure. You'd have to check the documentation for what it expects. callback by framework: theButton.pressed((clock, x, y)) defined as: def pressed(self, event): (granted, having the mouse x/y coordinates may not mean much for a screen button) callback by framework: mouseHandler.move((clock, x, y, lmb, rmb, mmb)) defined as: def move(self, event): (xmb is left/right/middle mouse button state) But if it is not being called by the framework, the arrangement/number of arguments is under your control. If it is a method of a class instance, it will receive the instance object as the first argument: object.method(arglist) => method(self, arglist) {where self IS object}. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/