While we're (I'm) changing things there one more thing that's bugged
me a little.
When you wrap a class you can specify whether a "Delete()" function
will be created with the %delete binding tag. This means that a
function called "Delete()" will be created so you can explicitly
delete userdata when you're done, rather than letting the lua garbage
collector do it or wxWidgets do it.
This is VERY important for wxPaintDCs (or any DC) and wxColours,
wxPens, wxBrushes, wxBitmaps, wxIcons, and wxCursors (any GDI object)
since MSW only has a limited number of them. In Win 9x you were
limited to hundreds IIRC, but I've even had problems in XP where it
stoped redrawing menus and whatnot if you get too many GDI objects.
The problem is that the lua garbage collector doesn't know any better
and lets them collect. This is fine for wxPoints and other things and
it's not a serious problem. Many people have asked on the lua list
about how to handle such a thing, but no viable solution (that I
remember seeing) has been proposed besides rewriting the lua
internals. So... we're stuck with having to explicitly delete certain
things we're done with.
Anyway... The name of this function, "Delete()", is *very* generic and
will probably conflict with some class function eventually and I'm
surprised it hasn't already.
What if we rename it to "delete()", lower case, since that is a NOT a
valid name for a class member function (I just tried it) and so there
cannot be a conflict with anything that ever gets bound by wxLua.
This will also match the "new(...)" function that you can now use for
class constructors.
Regards,
John Labenski
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users