I hope this version will run “strict” is a popular module used to prevent leaky variables, most useful.
This code emulates the spin control and should make it easier to support your variations. I hope it works. I just shorten the lines. Line are not properly broken and probably should be adjusted for clarity. local baseID = wx.wxID_HIGHEST + 1 textControls = {} frame = wx.wxFrame(wx.NULL, wx.wxID_ANY,'Test spin control') frame:Show(true) function spin(event) local localSpin = event:GetEventObject(): DynamicCast("wxSpinButton") print(localSpin.Value) print(event.Id) textControls[event.Id - baseID + 1][1].Value = tostring(localSpin.Value)..'!' end function text(event) print(event.KeyCode) event:Skip() local localText = event:GetEventObject(): DynamicCast("wxTextCtrl") local v = tonumber(localText.Value) print(v) if v then textControls[event.Id - baseID + 1][2].Value = v end end for ID= baseID, baseID + 10 do local top = 30*#textControls local textControl = wx.wxTextCtrl(frame, ID, 'test', wx.wxPoint(20,top)) local spinControl = wx.wxSpinButton(frame, ID, wx.wxPoint(0,top)) table.insert(textControls, {textControl, spinControl}) spinControl:SetRange(10,20) spinControl:Connect(wx.wxEVT_SCROLL_LINEUP, spin) spinControl:Connect(wx.wxEVT_SCROLL_LINEDOWN, spin) textControl:Connect(wx.wxEVT_KEY_DOWN, text) end wx.wxGetApp():MainLoop() Good luck. Andre ------------------------------------------------------------------------------ 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