From: Steve K. <ha...@ya...> - 2006-05-26 00:05:14
|
Hi there, I am looking around and not yet find any; Look at data.i; it has mapping for wxArrayInt, wxArrayString. With wxArrayString it has constructor so I can use it normally. But not for ArrayInt ; Also many others does not have constructor as well; If I write a_i=wx.wxArrayInt() -- error the right one is nil a_i=wx.wxArrayInt -- no complain but a_i:Add(122) -- a_i is nil Thanks in advance. Cheers S.KIEU --------------------------------- On Yahoo!7 Answers: Real people ask and answer questions on any topic. |
From: John L. <jla...@gm...> - 2006-05-26 02:17:06
|
On 5/25/06, Steve Kieu <ha...@ya...> wrote: > Hi there, > > I am looking around and not yet find any; > > Look at data.i; it has mapping for wxArrayInt, wxArrayString. With > wxArrayString it has constructor so I can use it normally. But not for > ArrayInt ; Also many others does not have constructor as well; I guess the thought was that normally you'd just use a lua table as an int array. I've added constructors for wxArrayInt so it should work now. You can check to see all the wxLua classes and their member functions here. http://wxlua.sourceforge.net/docs/wxluaref.html -John Labenski |
From: Steve K. <ha...@ya...> - 2006-05-26 03:52:38
|
Hi, Actually this is needed as I bind some widgets (c++) to wxLua and they have used such array using the wxWidgets macro; and I would like to access it as well. For typical example is the wxArrayTreeItemIds is defined in .i file but no constructor as well then some third party class used this for the return value and it is really handy when you want to control the tree; the wxTreeCtrl understand it rather than the lua table we construct. You are right that most of uses is realy needed to have constructor (you get the return value from the c++ method ) but sometimes ... Of course for all others ; better off using {} :-) Cheers, BTW, the class reference you point is the current CVS version right? I still _have_ to use the released version though because of some other dependency to lua 5.0 ; 2.6.2.0; which is still very good to me. Thanks. Cheers John Labenski <jla...@gm...> wrote: On 5/25/06, Steve Kieu wrote: > Hi there, > > I am looking around and not yet find any; > > Look at data.i; it has mapping for wxArrayInt, wxArrayString. With > wxArrayString it has constructor so I can use it normally. But not for > ArrayInt ; Also many others does not have constructor as well; I guess the thought was that normally you'd just use a lua table as an int array. I've added constructors for wxArrayInt so it should work now. You can check to see all the wxLua classes and their member functions here. http://wxlua.sourceforge.net/docs/wxluaref.html -John Labenski ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ Wxlua-users mailing list Wxl...@li... https://lists.sourceforge.net/lists/listinfo/wxlua-users S.KIEU --------------------------------- The LOST Ninja blog: Exclusive clues, clips and gossip. |
From: John L. <jla...@gm...> - 2006-05-26 16:03:24
|
On 5/25/06, Steve Kieu <ha...@ya...> wrote: > Actually this is needed as I bind some widgets (c++) to wxLua and they have > used such array using the wxWidgets macro; and I would like to access it as > well. > For typical example is the wxArrayTreeItemIds is defined in .i file but > no constructor as well then some third party class used this for the return > value and it is really handy when you want to control the tree; the > wxTreeCtrl understand it rather than the lua table we construct. I have added wxArrayTreeItemIds too. > You are right that most of uses is realy needed to have constructor (you > get the return value from the c++ method ) but sometimes ... > > Of course for all others ; better off using {} :-) I've wondered about this. We can just use the C++ array structures as is, for example wxArrayInt or wxArrayString, but people have made it so that some functions return lua tables of ints or strings instead and I've maintained that. It would be easier for the binder to just return the natural C++ datatype and provide simple functions to convert between the C++ array and a lua table. Do you have any feelings about this? Currently it's a little bit of both, some functions return lua tables others wxArrayXXX. > BTW, the class reference you point is the current CVS version right? I still > _have_ to use the released version though because of some other dependency > to lua 5.0 ; 2.6.2.0; which is still very good to me. That's too bad. The new version really has quite a lot of new and better things. Please don't hesitate to tell us about anything else that's missing or doesn't work though. There's way to much to wxWidgets to test everything and I bet that I use less than 1/4 of the wrappers. Thanks, John Labenski |
From: Steve K. <ha...@ya...> - 2006-05-26 21:50:13
|
I've wondered about this. We can just use the C++ array structures as is, for example wxArrayInt or wxArrayString, but people have made it so that some functions return lua tables of ints or strings instead and I've maintained that. It would be easier for the binder to just return the natural C++ datatype and provide simple functions to convert between the C++ array and a lua table. Do you have any feelings about this? Currently it's a little bit of both, some functions return lua tables others wxArrayXXX. I think it depends on the use of the structure. If it will be used again in c++ code (so the lua just hold reference to the object and pass to another c++ object to process then it would be better to return exactly as is (wxArrayXXX). If the return data is used in lua code or different framework then it is best to use as table. That's too bad. The new version really has quite a lot of new and better things. Please don't hesitate to tell us about anything else that's missing or doesn't work though. There's way to much to I have tested CVS before it works good, but the problem is with luasql; the kepler project team has not updated it to lua-5.1 yet. Last time I remember ; the current luasql compiles and runs fine with lua-5.1 in Linux, but I have no way to make it run in windows (may be I am so bad in windows env), the binary just crashed, compiles gives errors. I have tight time so can not do furthur, but turn back to lua-5.0 for everything works. I hope by the time goes I can use the CVS again. To say about bugs, I found some minor problems and limitations with wxgenbind.lua in version 2.6.2.0 ; not sure if the problem found and correct in CVS version. %class %delete %encapsulate %noclassinfo a xxxx %endclass %class b set(a) xxxx %endclass When generated to the binding files, the above set(a) ; the line that pop the userdatatype 'a' is incorrectly generated, it uses GetIntType(xx) instead, then it will give compile error. I have to override it. AFter fixing this, compiler still gives error about can not find the constructor of a(void*) which is not available. So another step is add another bogus constructor for a(void* ) which is identical to a() Now things are fine in linux, but VC7 still gives one error for a specfic line, 'can not convert from void* to a* = strange as it happend for only one method; all others fine. I have to remove the method. 3. genwxbind does not like a line break between parameters of a method in .i files . It gives error; 4. The following is not accepted by genwxbind c++ class a { a(int v1, b v2=b()) } in .i if you write %class a a(int v1, b v2=b()) %endclass will give errors. I saw you work around it by not use default param in the () form, 5. If in c++ you have #define EmptyA a() there is no way to write in .i file %define EmptyA a() // Error %define EmptyA // Error Thank you for reading my long emails lol Cheers S.KIEU --------------------------------- The LOST Ninja blog: Exclusive clues, clips and gossip. |