On Thu, 24 Mar 2016 08:06:28 -0400, Dennis Lee Bieber wrote: > 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}.
I believe I understand. Thanks. If you can't tell, I'm new to Python so the learning process is on-going. -- <Wildman> GNU/Linux user #557453 The cow died so I don't need your bull! -- https://mail.python.org/mailman/listinfo/python-list