From: John L. <jr...@us...> - 2007-12-22 06:07:49
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16833/wxLua/docs Modified Files: FAQ.html changelog.txt wxlua.html wxluaref.html Log Message: * Updated the naming conventions of the wxLua C/C++ functions to get rid of the term "tag" which dates back to Lua 4. Lua 5 does not use "tags", but rather metatables to attach functions to userdata in Lua. The new term for the C++ objects that wxLua wraps in Lua userdata and assigns a metatable to are wxLua types. wxLua types < 0, the WXLUA_TXXX types, correspond to the LUA_TXXX Lua types. wxLua types > 0 are types from the bindings and denote a class or struct. - Most notably for people who have written their own overrides for their bindings will be that wxLuaState::PushUserTag() is now wxluaT_PushUserDataType(). Those two functions existed before, but basically did the same thing. The calling arguments of PushUserTag() were taken however and were the reverse of what PushUserDataType() had. - wxluaT_new/get/set/tag() are now wxluaT_new/setmetatable() and wxluaT_type() where the latter works just like lua_type(), but returns one of the wxLua types. - Fix crash in wxListCtrl and wxTreeCtrl::AssignImageList() to use the %ungc tag to release wxLua from deleting the input wxImageList. Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wxluaref.html 18 Dec 2007 01:03:32 -0000 1.44 --- wxluaref.html 22 Dec 2007 06:07:09 -0000 1.45 *************** *** 3964,3968 **** --- 3964,3973 ---- static void ClearTraceMasks()<br> static const <a href="#wxArrayString">wxArrayString</a> GetTraceMasks()<br> + <br> + <font color=#BB0055> <font color=#009900>// <i>%override</i> static void wxLog::SetTimestamp(const <a href="#wxString">wxString</a>& ts)</font></font><br> + <font color=#009900>// Allows an input of "nil" or no value to disable time stamping.</font><br> + <font color=#009900>// C++ Func: static void wxLog::SetTimestamp(const wxChar* ts)</font><br> static void SetTimestamp(const <a href="#wxString">wxString</a>& ts)<br> + <br> static bool GetVerbose()<br> static wxTraceMask GetTraceMask()<br> *************** *** 7786,7790 **** <br> bool Arrange(int flag = wxLIST_ALIGN_DEFAULT)<br> ! void AssignImageList(<a href="#wxImageList">wxImageList</a> *imageList, int which)<br> void ClearAll()<br> bool DeleteAllItems()<br> --- 7791,7795 ---- <br> bool Arrange(int flag = wxLIST_ALIGN_DEFAULT)<br> ! void AssignImageList(<i>%ungc</i> <a href="#wxImageList">wxImageList</a> *imageList, int which)<br> void ClearAll()<br> bool DeleteAllItems()<br> *************** *** 8441,8446 **** <a href="#wxTreeItemId">wxTreeItemId</a> AppendItem(const <a href="#wxTreeItemId">wxTreeItemId</a>& parent, const <a href="#wxString">wxString</a>& text, int image = -1, int selImage = -1, <a href="#wxTreeItemData">wxTreeItemData</a>* data = NULL)<br> <font color=#009900>//void AssignButtonsImageList(<a href="#wxImageList">wxImageList</a>* imageList)</font><br> ! void AssignImageList(<a href="#wxImageList">wxImageList</a>* imageList)<br> ! void AssignStateImageList(<a href="#wxImageList">wxImageList</a>* imageList)<br> void Collapse(const <a href="#wxTreeItemId">wxTreeItemId</a>& item)<br> void CollapseAndReset(const <a href="#wxTreeItemId">wxTreeItemId</a>& item)<br> --- 8446,8451 ---- <a href="#wxTreeItemId">wxTreeItemId</a> AppendItem(const <a href="#wxTreeItemId">wxTreeItemId</a>& parent, const <a href="#wxString">wxString</a>& text, int image = -1, int selImage = -1, <a href="#wxTreeItemData">wxTreeItemData</a>* data = NULL)<br> <font color=#009900>//void AssignButtonsImageList(<a href="#wxImageList">wxImageList</a>* imageList)</font><br> ! void AssignImageList(<i>%ungc</i> <a href="#wxImageList">wxImageList</a>* imageList)<br> ! void AssignStateImageList(<i>%ungc</i> <a href="#wxImageList">wxImageList</a>* imageList)<br> void Collapse(const <a href="#wxTreeItemId">wxTreeItemId</a>& item)<br> void CollapseAndReset(const <a href="#wxTreeItemId">wxTreeItemId</a>& item)<br> *************** *** 11786,11790 **** <br> int GetCap() const<br> ! <a href="#wxColour">wxColour</a>& GetColour() const<br> <font color=#009900>// int GetDashes(wxDash** dashes) const</font><br> int GetJoin() const<br> --- 11791,11795 ---- <br> int GetCap() const<br> ! <a href="#wxColour">wxColour</a> GetColour() const <font color=#009900>// not wxColur& so we allocate a new one</font><br> <font color=#009900>// int GetDashes(wxDash** dashes) const</font><br> int GetJoin() const<br> *************** *** 24508,24514 **** <br> WXLUAMETHOD_STATIC <font color=#009900>// Class member function is static</font><br> - WXLUAMETHOD_OVERLOAD <font color=#009900>// This is an overload function that will call others</font><br> - <font color=#009900>// and the min/maxargs for it are not valid,</font><br> - <font color=#009900>// but are the min and max of all functions</font><br> <br> WXLUAMETHOD_DELETE <font color=#009900>// This is the delete function that wxLua has generated</font><br> --- 24513,24516 ---- *************** *** 24516,24537 **** <font color=#009900>// original class.</font><br> <br> ! WXLUAMETHOD_OVERLOAD_BASE <font color=#009900>// Class method has been checked to see if it is</font><br> ! <font color=#009900>// overloaded from the base class.</font><br> ! <font color=#009900>// Check WXLUAMETHOD::basemethod and if !NULL</font><br> ! <font color=#009900>// this method is an overload from the base class</font><br> </font> </blockquote><font color=#0066CC><i>%endenum</i></font><br> <br> ! <font color=#006666><i>%define</i> WXLUAARG_None</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Nil</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Boolean</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_LightUserData</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Number</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_String</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Table</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Function</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_UserData</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Thread</font><br> ! <font color=#006666><i>%define</i> WXLUAARG_Integer</font><br> <br> <font color=#006666><i>%define</i> LUA_TNONE <font color=#009900>// (-1)</font></font><br> --- 24518,24540 ---- <font color=#009900>// original class.</font><br> <br> ! WXLUAMETHOD_CHECKED_OVERLOAD <font color=#009900>// Class method has been checked to see if it is</font><br> ! <font color=#009900>// overloaded from the base class.</font><br> ! <font color=#009900>// Check WXLUAMETHOD::basemethod and if !NULL</font><br> ! <font color=#009900>// this method is an overload from the base class</font><br> </font> </blockquote><font color=#0066CC><i>%endenum</i></font><br> <br> ! <font color=#006666><i>%define</i> WXLUA_TNONE</font><br> ! <font color=#006666><i>%define</i> WXLUA_TNIL</font><br> ! <font color=#006666><i>%define</i> WXLUA_TBOOLEAN</font><br> ! <font color=#006666><i>%define</i> WXLUA_TLIGHTUSERDATA</font><br> ! <font color=#006666><i>%define</i> WXLUA_TNUMBER</font><br> ! <font color=#006666><i>%define</i> WXLUA_TSTRING</font><br> ! <font color=#006666><i>%define</i> WXLUA_TTABLE</font><br> ! <font color=#006666><i>%define</i> WXLUA_TFUNCTION</font><br> ! <font color=#006666><i>%define</i> WXLUA_TUSERDATA</font><br> ! <font color=#006666><i>%define</i> WXLUA_TTHREAD</font><br> ! <font color=#006666><i>%define</i> WXLUA_TINTEGER</font><br> ! <font color=#006666><i>%define</i> WXLUA_TCFUNCTION</font><br> <br> <font color=#006666><i>%define</i> LUA_TNONE <font color=#009900>// (-1)</font></font><br> *************** *** 24549,24556 **** <font color=#990099><i>%rename</i> iswxluatype <i>%function</i> int wxlua_iswxluatype(int luatype, int wxluaarg_tag)</font><br> <br> ! <font color=#BB0055><font color=#009900>// <i>%override</i> [wxlua_typename, wxlua_type#, lua_typename, lua_type#] type(void* object)</font></font><br> <font color=#009900>// Given any type of object, returns four values:</font><br> ! <font color=#009900>// wxlua name of the type - wxLuaState::GetLuaTagName(wxlua_type)</font><br> ! <font color=#009900>// wxlua number of the type - wxlua_getwxluatype(lua_type(L, stack_idx)) or wxluaT_tag</font><br> <font color=#009900>// lua name of the type - lua_typename(L, lua_type(L, stack_idx))</font><br> <font color=#009900>// lua number of the type - lua_type(L, stack_idx)</font><br> --- 24552,24559 ---- <font color=#990099><i>%rename</i> iswxluatype <i>%function</i> int wxlua_iswxluatype(int luatype, int wxluaarg_tag)</font><br> <br> ! <font color=#BB0055><font color=#009900>// <i>%override</i> [wxlua_typename, wxlua_type#, lua_typename, lua_type#] type(any object)</font></font><br> <font color=#009900>// Given any type of object, returns four values:</font><br> ! <font color=#009900>// wxlua name of the type - wxluaT_gettypename(L, stack_idx)</font><br> ! <font color=#009900>// wxlua number of the type - wxluaT_type(L, stack_idx)</font><br> <font color=#009900>// lua name of the type - lua_typename(L, lua_type(L, stack_idx))</font><br> <font color=#009900>// lua number of the type - lua_type(L, stack_idx)</font><br> *************** *** 24590,24594 **** <br> int GetClassCount<br> ! int GetDefineCount<br> int GetStringCount<br> int GetEventCount<br> --- 24593,24597 ---- <br> int GetClassCount<br> ! int GetNumberCount<br> int GetStringCount<br> int GetEventCount<br> *************** *** 24598,24605 **** {wxLuaBindClass*} GetClassArray<br> {wxLuaBindMethod*} GetFunctionArray<br> ! {name, value} GetDefineArray<br> {name, value} GetStringArray<br> ! {name, eventType, class_tag} GetEventArray<br> ! {name, object, class_tag} GetObjectArray<br> <br> </font></blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><font color=#888888><br> --- 24601,24608 ---- {wxLuaBindClass*} GetClassArray<br> {wxLuaBindMethod*} GetFunctionArray<br> ! {name, value} GetNumberArray<br> {name, value} GetStringArray<br> ! {name, eventType, wxluatype} GetEventArray<br> ! {name, object, wxluatype} GetObjectArray<br> <br> </font></blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><font color=#888888><br> *************** *** 24610,24617 **** <br> <a href="#wxString">wxString</a> name<br> ! {wxLuaBindMethod*} methods<br> ! int methods_n<br> <a href="#wxClassInfo">wxClassInfo</a>* classInfo<br> ! int class_tag<br> <a href="#wxString">wxString</a> baseclassName<br> wxLuaBindClass* baseclass<br> --- 24613,24620 ---- <br> <a href="#wxString">wxString</a> name<br> ! {wxLuaBindMethod*} wxluamethods<br> ! int wxluamethods_n<br> <a href="#wxClassInfo">wxClassInfo</a>* classInfo<br> ! int wxluatype<br> <a href="#wxString">wxString</a> baseclassName<br> wxLuaBindClass* baseclass<br> *************** *** 24626,24632 **** <br> <a href="#wxString">wxString</a> name<br> ! int type<br> ! {wxLuaBindCFunc*} funcs<br> ! int funcs_n<br> wxLuaBindMethod* basemethod<br> <br> --- 24629,24635 ---- <br> <a href="#wxString">wxString</a> name<br> ! int method_type<br> ! {wxLuaBindCFunc*} wxluacfuncs<br> ! int wxluacfuncs_n<br> wxLuaBindMethod* basemethod<br> <br> *************** *** 24640,24648 **** <font color=#009900>// No constructor as this is read only</font><br> <br> ! cfunction func<br> ! int type<br> int minargs<br> int maxargs<br> ! {int} argtags<br> <br> <a href="#wxString">wxString</a> class_name <font color=#009900>// added, not in struct</font><br> --- 24643,24651 ---- <font color=#009900>// No constructor as this is read only</font><br> <br> ! cfunction lua_cfunc<br> ! int method_type<br> int minargs<br> int maxargs<br> ! {int} argtypes<br> <br> <a href="#wxString">wxString</a> class_name <font color=#009900>// added, not in struct</font><br> *************** *** 24679,24683 **** bool IsRunning() const<br> <br> - <a href="#wxString">wxString</a> GetLuaTagName(int tag) const<br> */</font><br> </blockquote><font color=#DD0000><font color=#DD0000><i>%endclass</i></font></font><br> --- 24682,24685 ---- Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wxlua.html 4 Sep 2007 22:21:10 -0000 1.34 --- wxlua.html 22 Dec 2007 06:07:08 -0000 1.35 *************** *** 2,7 **** <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! <meta content="John Labenski" name="author"></head> ! <body><h2><u>wxLua Documentation</u></h2> <a href="http://wxlua.sourceforge.net">wxLua</a> is --- 2,10 ---- <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua Documentation</title> ! [...3521 lines suppressed...] ! <ul> ! <li>Run ! a Lua file from disk.</li> ! <li>Returns Lua's error code ! LUA_ERRXXX or 0 on success</li> ! </ul> ! <li>int ! LuaPCall(int narg, int nresults)</li> ! <ul> ! <li>Uses lua_call to run a chunk on the stack, but sets ! things up for wxLua first.</li> ! <li>Returns Lua's error ! code LUA_ERRXXX or 0 on success</li> ! </ul> ! <li>There are many ! other functions which are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> ! </ul> ! </body></html> \ No newline at end of file Index: FAQ.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/FAQ.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FAQ.html 7 Aug 2007 19:09:55 -0000 1.5 --- FAQ.html 22 Dec 2007 06:07:08 -0000 1.6 *************** *** 1,182 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> ! ! ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! ! ! ! ! ! ! <title>wxLua FAQ</title><meta content="John Labenski" name="author"></head> ! <body> - - <h2><u>wxLua FAQ</u></h2> - - <ol> ! ! ! <li><a href="#Why_wxLua">Why wxLua?</a></li> ! ! ! ! <ol> ! ! ! <li><a href="#Whats_best_for_my_needs:_wxLua">What's best for my needs: wxLua, wxPython, wxSomethingElse?</a></li> ! ! ! <li><a href="FAQ.html#Can_I_use_wxLua_as_script_interpreter">Can I use wxLua as script interpreter embedded in my own C++ applications?</a></li> ! ! ! ! </ol> ! ! ! <li><a href="#Programming_in_wxLua">Programming in wxLua</a></li> ! ! ! ! <ol> ! ! ! <li><a href="#wxStrings">wxStrings?</a></li> ! ! ! <li><a href="#wxArrayString_and_wxSortedArrayString">wxArrayString and wxSortedArrayString?</a></li> ! ! ! <li><a href="#wxArrayInt">wxArrayInt?</a></li> ! ! ! <li><a href="#When_and_how_should_you_delete_objects">When and how should you delete() objects?</a></li> ! ! ! <li><a href="#Why_do_the_samples_use_the_function">Why do the samples use the function main() and is it special to wxLua?</a></li> ! ! ! <li><a href="#Why_are_the_error_messages_for_a_class">Why ! are the error messages for class member function calls shifted ! +1?</a></li> ! ! ! ! </ol> ! ! </ol> - - <hr size="2" width="100%"> <ol> ! ! ! <li> ! ! <h3><a name="Why_wxLua"></a>Why wxLua?</h3> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>Because the Lua language is easy and "fun" to program in. </li> ! ! ! <li>It vaguely looks like BASIC or C which many people are familiar with.</li> ! ! ! <li>The code is very readable, almost no special notation, gotchas, or oddball constructs that require a large shift in thinking from BASIC or C.</li> ! ! ! <li>Size : The Lua interpreter itself is ~100Kb, wxWidgets adds the remaining few Mb.</li> ! ! ! <li>Speed : Lua is one of the fastest interpreted languages, see the Great Computer Language Shootout.</li> ! ! ! <li>Again, why Lua? See <a href="http://www.lua.org/about.html">http://www.lua.org/about.html</a></li> ! ! ! ! </ul> ! ! ! ! <ol> ! ! ! <li> ! ! <h4><a name="Whats_best_for_my_needs:_wxLua"></a>What's best for my needs: wxLua, wxPython, wxSomethingElse?</h4> ! ! ! </li> ! ! ! ! <ol> ! ! ! ! <ol> ! ! ! ! </ol> ! ! ! ! </ol> ! ! ! ! <ul> ! ! ! <li>It depends: wxPython has a much larger footprint and greater overhead than wxLua, but it does provide more add-ons from the Python standard library.</li> ! ! ! <li>On the other hand, wxLua is as large as the wxWidgets library + ~100Kb for Lua + ~500Kb for the wxLua library.</li> ! ! ! <li>wxLua can be easily interfaced with C++ code making it a powerful extension language, which is exactly the intent of its designers.</li> ! ! ! <li>In conclusion, if you want to write an entire application in a scripting language and you need things supported by Python which are --- 1,86 ---- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> + <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>wxLua FAQ</title> ! <meta content="John Labenski" name="author"> ! </head> <body> <h2><u>wxLua FAQ</u></h2> <ol> ! <li><a href="#Why_wxLua">Why wxLua?</a></li> ! <ol> ! <li><a href="#Whats_best_for_my_needs:_wxLua">What's best for my needs: wxLua, wxPython, wxSomethingElse?</a></li> ! <li><a href="FAQ.html#Can_I_use_wxLua_as_script_interpreter">Can I use wxLua as script interpreter embedded in my own C++ applications?</a></li> ! </ol> ! <li><a href="#How_to_Learn_wxLua">How to learn ! wxLua</a></li> ! <ol> ! <li><a href="#Read_the_wxLua_documentation">Read ! the wxLua documentation</a></li> ! <li><a href="#Read_the_C_wxWidgets_documentation">Read ! the C++ wxWidgets documentation</a></li> ! <li><a href="#Run_and_trace_through_the_samples">Run ! and trace through the samples</a></li> ! </ol> ! <li><a href="#Programming_in_wxLua">Programming in wxLua</a></li> ! <ol> ! <li><a href="#wxStrings">wxStrings?</a></li> ! <li><a href="#wxArrayString_and_wxSortedArrayString">wxArrayString and wxSortedArrayString?</a></li> ! <li><a href="#wxArrayInt">wxArrayInt?</a></li> ! <li><a href="#When_and_how_should_you_delete_objects">When and how should you delete() objects?</a></li> ! <li><a href="#Why_do_the_samples_use_the_function">Why do the samples use the function main() and is it special to wxLua?</a></li> ! <li><a href="#Why_are_the_error_messages_for_a_class">Why ! are the arguments shifted +1 for error messages from class member ! function calls?</a></li> ! </ol> </ol> <hr size="2" width="100%"> <ol> ! <li> ! <h3><a name="Why_wxLua"></a>Why wxLua?</h3> ! </li> ! <ul> ! <li>Because the Lua language is easy and "fun" to program in. </li> ! <li>It vaguely looks like BASIC or C which many people are familiar with.</li> ! <li>The code is very readable, almost no special notation, gotchas, or oddball constructs that require a large shift in thinking from BASIC or C.</li> ! <li>Size : The Lua interpreter itself is ~100Kb, wxWidgets adds the remaining few Mb.</li> ! <li>Speed : Lua is one of the fastest interpreted languages, see the Great Computer Language Shootout.</li> ! <li>Again, why Lua? See <a href="http://www.lua.org/about.html">http://www.lua.org/about.html</a></li> ! </ul> ! <ol> ! <li> ! <h4><a name="Whats_best_for_my_needs:_wxLua"></a>What's best for my needs: wxLua, wxPython, wxSomethingElse?</h4> ! </li> ! <ul> ! <li>It depends: wxPython has a much larger footprint and greater overhead than wxLua, but it does provide more add-ons from the Python standard library.</li> ! <li>On the other hand, wxLua is as large as the wxWidgets library + ~100Kb for Lua + ~500Kb for the wxLua library.</li> ! <li>wxLua can be easily interfaced with C++ code making it a powerful extension language, which is exactly the intent of its designers.</li> ! <li>In conclusion, if you want to write an entire application in a scripting language and you need things supported by Python which are *************** *** 184,336 **** Instead, if you want to write applications with little overhead or extend your C++ applications, go for wxLua.</li> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="Can_I_use_wxLua_as_script_interpreter"></a>Can I use wxLua as script interpreter embedded in my own C++ applications?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>Yes! That's explained on the wxLua homepage. </li> ! ! ! <li>This is one of the strong points of wxLua: it can be a lightweight, fast interpreter to extend your application and let the user customize it... </li> ! ! ! <li>You may create as many wxLua interpreters in a single program as you like.</li> ! ! ! ! </ul> ! ! ! ! </ol> ! ! ! <li> ! ! <h3><a name="Programming_in_wxLua"></a>Programming in wxLua</h3> ! ! ! </li> ! ! ! ! <ol> ! ! ! <li> ! ! <h4><a name="wxStrings"></a>wxStrings?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>wxLua uses Lua strings and so all functions that take or return a wxString take or return a Lua string.</li> ! ! ! <li>However, you can also use a wxString if you really want.</li> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="wxArrayString_and_wxSortedArrayString"></a>wxArrayString and wxSortedArrayString?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>All functions that take a wxArrayString or wxSortedArrayString can also take a numerically indexed table of strings.</li> ! ! ! <li>Functions that return wxArrayStrings or wxSortedArrayStrings will return a wxArrayString or wxSortedArrayString unless specified otherwise in wxluaref.html</li> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="wxArrayInt"></a>wxArrayInt?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>All functions that take a wxArrayInt can also take a numerically indexed table of numbers.</li> ! ! ! <li>Functions that return wxArrayInts will return a wxArrayInt unless specified otherwise in wxluaref.html.</li> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="When_and_how_should_you_delete_objects"></a>When and how should you delete() objects?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>You should read the subsection "C++ Classes ! CLASS_NAME" of the "Programming in wxLua" section of the wxlua.html manual.</li> ! ! ! <li>In short, all objects that you create that deal with graphics should be delete()ed as soon as they're no longer used. Functions that take a --- 88,205 ---- Instead, if you want to write applications with little overhead or extend your C++ applications, go for wxLua.</li> ! </ul> ! <li> ! <h4><a name="Can_I_use_wxLua_as_script_interpreter"></a>Can I use wxLua as script interpreter embedded in my own C++ applications?</h4> ! </li> ! <ul> ! <li>Yes! That's explained on the wxLua homepage. </li> ! <li>This is one of the strong points of wxLua: it can be a lightweight, fast interpreter to extend your application and let the user customize it... </li> ! <li>You may create as many wxLua interpreters in a single program as you like.</li> ! </ul> ! </ol> ! <li> ! <h3><a name="How_to_Learn_wxLua"></a>How ! to Learn wxLua</h3> ! </li> ! <ol> ! <li> ! <h4><a name="Read_the_wxLua_documentation"></a>Read ! the wxLua documentation</h4> ! </li> ! <ul> ! <li>wxlua.html is the manual for wxLua that describes the ! Lua language as well as where the wxWidgets C++ are placed in Lua and ! how to use them.</li> ! <li>wxluaref.html is an autogenerated document that can be ! thought of as a reference manual of what wxLua binds from wxWidgets. It ! also has usage notes for the cases where wxLua differs from C++ ! wxWidgets.</li> ! <li>binding.html describes how to write your own bindings ! for a C or C++ library, but people who will only write Lua code should ! also read it to be able to interpret the wxluaref.html document.</li> ! </ul> ! <li> ! <h4><a name="Read_the_C_wxWidgets_documentation"></a>Read ! the C++ wxWidgets documentation</h4> ! </li> ! <ul> ! <li>wxLua is mapped very closely to wxWidgets ! which means that descriptions for the functions and values there also ! apply to wxLua. See the wxluaref.html document to verify that this is ! the case and any non typical behavior will be clearly marked.</li> ! <li>See the wxWidgets Wiki for examples of ! code, beginner howtos, and other useful bits of information ! that might be useful.</li> ! <li>See wxPython documentation and their Wiki, but note ! that wxLua follows the C++ notation a little closer than wxPython does.</li> ! </ul> ! <li> ! <h4><a name="Run_and_trace_through_the_samples"></a>Run ! and trace through the samples</h4> ! </li> ! <ul> ! <li>The samples try to show off various classes and their ! usage.</li> ! <li>unittest.wx.lua is used to confirm that wxLua is ! operating properly, however it provides a wealth of information about ! what is allowed in terms of calling functions, casting classes to other ! classes, using virtual functions, and derived functions.</li> ! <li>binding.wx.lua traverses the C structs that store the ! data used for wxLua and it's worth taking the time to browse them to ! see how it all fits together.</li> ! </ul> ! </ol> ! <li> ! <h3><a name="Programming_in_wxLua"></a>Programming in wxLua</h3> ! </li> ! <ol> ! <li> ! <h4><a name="wxStrings"></a>wxStrings?</h4> ! </li> ! <ul> ! <li>wxLua uses Lua strings and so all functions that take or return a wxString take or return a Lua string.</li> ! <li>However, you can also use a wxString if you really want.</li> ! </ul> ! <li> ! <h4><a name="wxArrayString_and_wxSortedArrayString"></a>wxArrayString and wxSortedArrayString?</h4> ! </li> ! <ul> ! <li>All functions that take a wxArrayString or wxSortedArrayString can also take a numerically indexed table of strings.</li> ! <li>Functions that return wxArrayStrings or wxSortedArrayStrings will return a wxArrayString or wxSortedArrayString unless specified otherwise in wxluaref.html</li> ! </ul> ! <li> ! <h4><a name="wxArrayInt"></a>wxArrayInt?</h4> ! </li> ! <ul> ! <li>All functions that take a wxArrayInt can also take a numerically indexed table of numbers.</li> ! <li>Functions that return wxArrayInts will return a wxArrayInt unless specified otherwise in wxluaref.html.</li> ! </ul> ! <li> ! <h4><a name="When_and_how_should_you_delete_objects"></a>When and how should you delete() objects?</h4> ! </li> ! <ul> ! <li>You should read the subsection "C++ Classes ! CLASS_NAME" of the "Programming in wxLua" section of the wxlua.html ! manual.</li> ! <li>In short, all objects that you create that deal with graphics should be delete()ed as soon as they're no longer used. Functions that take a *************** *** 341,354 **** refed copy of them and so you may delete them.</li> ! ! ! <li>Use ! the function "table = wxlua.GetTrackedUserdata()" to get a table of ! items that are tracked and occasionally print them out while developing your program.</li> ! ! ! <li>Class objects that have the <i>%delete</i> tag in their declaration (see wxluaref.html) will be automatically ! garbage collected or can be delete()ed with a wxLua added function for the class. There are, of course, exceptions and these occur when you pass the object to a function with the <i>%ungc</i> tag on --- 210,221 ---- refed copy of them and so you may delete them.</li> ! <li>Use ! the function "table = wxlua.GetGCUserdataInfo()" to get a table of ! items that are tracked and either have an active variable pointing to ! them or are waiting to be garbage collected.</li> ! <li>Class objects that have the <i>%delete</i> tag in their declaration (see wxluaref.html) will be automatically ! garbage collected or can be delete()ed with the wxLua added function ! for the class. There are, of course, exceptions and these occur when you pass the object to a function with the <i>%ungc</i> tag on *************** *** 356,473 **** specifies that the object is now owned by something else and you can no longer delete it in wxLua.</li> ! ! ! <li>Bottom line - don't worry about delete()ing anything ! except:</li><ul><li>Graphics objects (for MSW really).</li><li>Classes that specifically state (in wxluaref.html) that you should delete() them because the ! garbage collector may not do so soon enough.</li><li>Objects that may be very large, like a wxImage(1000, 1000).</li></ul> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="Why_do_the_samples_use_the_function"></a>Why do the samples use the function main() and is it special to wxLua?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>There's nothing special about the function main() other than that it's a common name for an entry point into a program.</li> ! ! ! <li>It is often helpful and a good idea to encapsulate the program initialization code within a function so that you can use local variables and not pollute the global table with temporary variables that won't be needed again.</li> ! ! ! <li>Additionally, it allows you to break out of this initialization code at any point by putting <span style="font-style: italic;">"do return end"</span> inside of the function for debugging, as opposed to wrapping parts you don't want using <span style="font-style: italic;">"if false then ... end"</span>.</li> ! ! ! ! </ul> ! ! ! <li> ! ! <h4><a name="Why_are_the_error_messages_for_a_class"></a>Why ! are the error messages for class member function calls shifted ! +1?</h4> ! ! ! </li> ! ! ! ! <ul> ! ! ! <li>Because the ':' calling convention is syntaxic sugar for putting the 'self' as the first parameter.</li> ! ! ! <li><i>s = wx.wxSize(1, 2); s:Set(3, 4)</i> is the same as <i>s.Set(s, 3, 4)</i> and the first parameter is always the self, therefore <i>s.Set(s, ! "hello", 4)</i> will give an error that parameter 2 is not a number.</li> ! ! ! <li>Unfortunately there is no way to tell whether the user has used the '.' or ':' calling convention and so the error message ! cannot be tailored for both static and nonstatic member functions. Just remember that the first parameter for nonstatic class ! member functions called using the ':' notation is the 'self'.</li> ! ! ! ! </ul> ! ! ! ! </ol> ! ! ! ! <ol> ! ! ! ! <ol> ! ! ! ! </ol> ! ! ! ! </ol> ! ! ! ! <ul> ! ! ! ! </ul> ! ! </ol> - - </body></html> \ No newline at end of file --- 223,277 ---- specifies that the object is now owned by something else and you can no longer delete it in wxLua.</li> ! <li>Bottom line - don't worry about delete()ing anything ! except:</li> ! <ul> ! <li>Graphics objects (for MSW really).</li> ! <li>Classes that specifically state (in wxluaref.html) that you should delete() them because the ! garbage collector may not do so soon enough.</li> ! <li>Objects that may be very large, like a wxImage(1000, ! 1000).</li> ! </ul> ! </ul> ! <li> ! <h4><a name="Why_do_the_samples_use_the_function"></a>Why do the samples use the function main() and is it special to wxLua?</h4> ! </li> ! <ul> ! <li>There's nothing special about the function main() other than that it's a common name for an entry point into a program.</li> ! <li>It is often helpful and a good idea to encapsulate the program initialization code within a function so that you can use local variables and not pollute the global table with temporary variables that won't be needed again.</li> ! <li>Additionally, it allows you to break out of this initialization code at any point by putting <span style="font-style: italic;">"do return end"</span> inside of the function for debugging, as opposed to wrapping parts you don't want using <span style="font-style: italic;">"if false then ... end"</span>.</li> ! </ul> ! <li> ! <h4><a name="Why_are_the_error_messages_for_a_class"></a>Why ! are the arguments shifted +1 for error messages from class member ! function calls?</h4> ! </li> ! <ul> ! <li>Because the ':' calling convention is syntaxic sugar for putting the 'self' as the first parameter.</li> ! <li><i>s = wx.wxSize(1, 2); s:Set(3, 4)</i> is the same as <i>s.Set(s, 3, 4)</i> and the first parameter is always the self, therefore <i>s.Set(s, ! "hello", 4)</i> or <i>s:Set("hello", 4)</i> will ! give an error that parameter 2 is not a number.</li> ! <li>Unfortunately there is no way to tell whether the user has used the '.' or ':' calling convention and so the error message ! cannot be tailored for both static and nonstatic member functions. Just remember that the first parameter for nonstatic class ! member functions called using the ':' notation is the 'self'.</li> ! </ul> ! </ol> </ol> </body></html> \ No newline at end of file Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** changelog.txt 20 Dec 2007 02:26:55 -0000 1.54 --- changelog.txt 22 Dec 2007 06:07:08 -0000 1.55 *************** *** 85,88 **** --- 85,107 ---- and call the generic overload function or just the single function. + * Updated the naming conventions of the wxLua C/C++ functions to get rid of + the term "tag" which dates back to Lua 4. Lua 5 does not use "tags", but + rather metatables to attach functions to userdata in Lua. + The new term for the C++ objects that wxLua wraps in Lua userdata and + assigns a metatable to are wxLua types. + wxLua types < 0, the WXLUA_TXXX types, correspond to the LUA_TXXX Lua types. + wxLua types > 0 are types from the bindings and denote a class or struct. + - Most notably for people who have written their own overrides for their + bindings will be that wxLuaState::PushUserTag() is now wxluaT_PushUserDataType(). + Those two functions existed before, but basically did the same thing. + The calling arguments of PushUserTag() were taken however and were the + reverse of what PushUserDataType() had. + - wxluaT_new/get/set/tag() are now wxluaT_new/setmetatable() and + wxluaT_type() where the latter works just like lua_type(), but returns + one of the wxLua types. + + - Fix crash in wxListCtrl and wxTreeCtrl::AssignImageList() to use the + %ungc tag to release wxLua from deleting the input wxImageList. + version 2.8.4.2 -------------------------------------------------------------------- |