Steve Kieu ha scritto:
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?
did you hand-write the XRC ?
To me it looks like a wx problem; you could try to modify the 'xrc'
sample to see if you can reproduce with wxWidgets directly.
Assuming this is a wx bug, I suggest you to use a sizer inside the frame
wrapping the panel; maybe this will workaround the bug.
HTH,
Francesco
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users