Update of /cvsroot/wxlua/wxLua/samples
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8338/wxLua/samples
Modified Files:
controls.wx.lua
Log Message:
Fix controls sample for separated wxWidgets bindings
Check for MainLoop already running in luamodule
Index: controls.wx.lua
===================================================================
RCS file: /cvsroot/wxlua/wxLua/samples/controls.wx.lua,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** controls.wx.lua 16 Jul 2007 19:35:31 -0000 1.12
--- controls.wx.lua 18 Jul 2007 02:41:33 -0000 1.13
***************
*** 31,34 ****
--- 31,35 ----
listImageList:Add(wx.wxArtProvider.GetBitmap(wx.wxART_ERROR, wx.wxART_TOOLBAR, wx.wxSize(16, 16)))
+ bindingList = wxlua.GetBindings() -- Table of {wxLuaBinding functions}
controlTable = {} -- Table of { win_id = "win name" }
***************
*** 103,108 ****
-- Turn the array from the binding into a lookup table by event type
wxEVT_List = {}
- wxEVT_Array = wxLuaBinding_wx.GetEventArray
wxEVT_TableByType = {}
for i = 1, #wxEVT_Array do
--- 104,116 ----
-- Turn the array from the binding into a lookup table by event type
+ wxEVT_Array = bindingList[1].GetEventArray
+ for i = 2, #bindingList do
+ local evtArr = bindingList[i].GetEventArray
+ for j = 1, #evtArr do
+ table.insert(wxEVT_Array, evtArr[j])
+ end
+ end
+
wxEVT_List = {}
wxEVT_TableByType = {}
for i = 1, #wxEVT_Array do
***************
*** 113,117 ****
-- Turn the array from the binding into a lookup table by class name
! wxCLASS_Array = wxLuaBinding_wx.GetClassArray
wxCLASS_TableByName = {}
for i = 1, #wxCLASS_Array do
--- 121,132 ----
-- Turn the array from the binding into a lookup table by class name
! wxCLASS_Array = bindingList[1].GetClassArray
! for i = 2, #bindingList do
! local classArr = bindingList[i].GetClassArray
! for j = 1, #classArr do
! table.insert(wxCLASS_Array, classArr[j])
! end
! end
!
wxCLASS_TableByName = {}
for i = 1, #wxCLASS_Array do
|