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


Groups > comp.lang.python > #105603

Re: Key Binding Problem

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Newsgroups comp.lang.python
Subject Re: Key Binding Problem
Date 2016-03-24 08:06 -0400
Organization IISS Elusive Unicorn
Message-ID <mailman.90.1458821171.2244.python-list@python.org> (permalink)
References (2 earlier) <L6KdnXoY773thm_LnZ2dnUU7-QOdnZ2d@giganews.com> <mailman.31.1458715678.2244.python-list@python.org> <GZ-dnUtlpauMIG_LnZ2dnUU7-S-dnZ2d@giganews.com> <mailman.74.1458780091.2244.python-list@python.org> <06adnbnMouHI027LnZ2dnUU7-XednZ2d@giganews.com>

Show all headers | View raw


On Wed, 23 Mar 2016 21:17:57 -0500, Wildman via Python-list
<python-list@python.org> 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/

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


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