Hi,
I am not quite sure that this is bug in wxLua or wxWidgets or I am doing something wrong. Maybe it is in wxWidgets (I think).
The problem is the XRC can not load a panel ; .
To illustrate, I have a very simple xrc like this:
<?xml version="1.0" encoding="UTF-8"?>
<resource version="2.3.0.1" xmlns="http://www.wxwidgets.org/wxxrc">
<object class="wxFrame" name="ID_FRAME" subclass="t">
<style>wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX</style>
<size>400,300</size>
<title>t</title>
<object class="wxPanel" name="ID_PANEL">
<style>wxSUNKEN_BORDER|wxTAB_TRAVERSAL</style>
</object>
</object>
</resource>
suppose the xrc file name below is correct (the above one)
lua script:
local frame=nil
res = wx.wxXmlResourceGetDefault()
res:InitAllHandlers()
local xrcFilename = "./test.xrc"
res:Load(xrcFilename)
frame = wx.wxFrame(wx.wxNull, wx.wxID_ANY, "My Frame")
res:LoadFrame(frame, wx.wxNull, "ID_FRAME")
local myPanel=wx.wxPanel(wx.wxNull, wx.wxID_ANY)
res:LoadPanelCreate(myPanel, frame, "ID_PANEL" )
If you run this script wxlua report error:
XRC resource 'ID_PANEL' (class 'wxPanel') not found
As you see in xrc file ID_PANEL is the panel, why not find it?
Viewing examples of wxwidgets and wxlua dealing with XRC, it seems that everybody use dialog instead of frame + panel, so maybe no one got that problem so far.
Any comment?
Cheers,
S.KIEU
On Yahoo!7
360°: Your own space to share what you want with who you want!
