It's possible to get the evt globally

Hi Karsten Hilbert

So, the getitem method could be

def getitem(self, item_name):
if isinstance(item_name, str):
return wx.FindWindowByName(item_name, parent=self)
elif isinstance(item_name, int):
return wx.```FindWindowById`(item_name, parent=self)

···

El jueves, 5 de abril de 2018, 14:10:43 (UTC-5), Tim Roberts escribió:

sebastian lópez wrote:

It’s possible to make something like this

from wx import evt

          def funccallbac(param1):

                if evt.GetKeyCode() == 13:

                    return
            do_something()

                return

``

    The objective is to be able to call a function but without the

need of passing the event as a function argument.

No.  That's simply not how it works.  Events callbacks are passed

one parameter – the event.

What do you think you'd be accomplishing by this?
-- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Yes.

Karsten

···

On Mon, Apr 09, 2018 at 06:32:29AM -0700, sebastian lópez wrote:

So, the __getitem__ method could be

def __getitem__(self, item_name):
       if isinstance(item_name, str):
           return wx.FindWindowByName(item_name, parent=self)
       elif isinstance(item_name, int):
          return wx.FindWindowById(item_name, parent=self)

--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346