Andre Arpin <ar...@kingston.net> wrote:
(30/12/2010 14:36)

>> for I=7,151 do
>>   CT[I]:Connect(wx.wxEVT_KILL_FOCUS,
>>     function(EV)  FeedBack(EV:GetId())  end
>>   )
>> end
>> 
>
>> What about:
>local function KILL_FOCUS(EV)  FeedBack(EV:GetId()
>
>for I=7,151 do
>   CT[I]:Connect(wx.wxEVT_KILL_FOCUS, KILL_FOCUS)
>end
>
>
>151 pointers to one function
>
>better 
>
>function FeedBack(event)
>   local Id = event.Id
>   ..... old code for feed back
>end
>
>for I=7,151 do
>   CT[I]:Connect(wx.wxEVT_KILL_FOCUS, FeedBack)
>end
>

This is a bit like focussing on a leaky tap in a burning building, given the 
other more serious problems with Spinctrl. I know attention to details matters, 
but not at the expense of the whole picture. I think this is why Spinctrl got 
broken in the first place! Too much specialisation... Not good for science in 
general. Certainly not good for code.

That said, I'll bite. :) It's still worth discussing. I see your point, but I 
have other calls to FeedBack() that have an ID, are not event driven. If I 
could test for variable type at the start of FeedBack() this might work, 
possibly? I don't know if the event passed to a variable HAS a type. in the Lua 
sense of the word...


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to