From: John L. <jr...@us...> - 2007-07-01 02:23:58
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10085/wxLua/docs Modified Files: FAQ.html Log Message: fix some bad grammar Index: FAQ.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/FAQ.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAQ.html 25 Jun 2007 03:19:38 -0000 1.3 --- FAQ.html 1 Jul 2007 02:23:53 -0000 1.4 *************** *** 3,50 **** <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() is it special to wxLua?</a></li> <li><a href="#Why_are_the_error_messages_for_a_class">Why --- 3,73 ---- <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 *************** *** 52,111 **** --- 75,167 ---- +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 *************** *** 113,120 **** --- 169,178 ---- 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 *************** *** 122,125 **** --- 180,184 ---- designers.</li> + <li>In conclusion, if you want to write an entire application in a *************** *** 129,146 **** --- 188,214 ---- 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 *************** *** 148,193 **** --- 216,287 ---- 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 is 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 *************** *** 195,225 **** 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 section "C++ Classes ! CLASS_NAME" in the "Programming in wxLua" in the wxlua.html manual.</li> <li>In --- 289,337 ---- 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 *************** *** 233,240 **** --- 345,354 ---- 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 *************** *** 246,249 **** --- 360,364 ---- longer delete it in wxLua.</li> + <li>Bottom line - don't worry about delete()ing anything except graphics objects (for MSW really) or classes that specifically *************** *** 251,267 **** garbage collector may not do so soon enough.</li> </ul> <li> <h4><a name="Why_do_the_samples_use_the_function"></a>Why ! do the samples use the function main() 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 --- 366,391 ---- garbage collector may not do so soon enough.</li> + + </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 *************** *** 270,273 **** --- 394,398 ---- 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> *************** *** 276,293 **** --- 401,427 ---- 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 *************** *** 296,322 **** 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 call member ! functions.</li> </ul> </ol> <ol> <ol> </ol> </ol> <ul> </ul> </ol> </body> </html> --- 430,475 ---- 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 is the 'self'.</li> + + </ul> + + </ol> + + <ol> + + <ol> + + </ol> + + </ol> + + <ul> + + </ul> + </ol> + </body> </html> |