From: Robert M. <rm...@po...> - 2005-08-08 18:41:02
|
Jeremy White wrote: > I've just committed a change that added two new methods, GetParent and > UserData - both of which can be called on controls or windows. > > GetParent simply returns the parent window of the control or child > window (if there was one). Just one comment here - if the parent doesn't have valid userdata, should GetParent() return the hwnd, like most other calls do? Should we be looking at extending/changing other api calls to return objects, where such objects exist? > UserData allows you to associate an SV to a control or window, allowing > you to save instance data to that object. Nice. I hadn't thought of holding a separate reference to the userdata, and so avoiding the circular references. I think we may still see problems with the reference causing 'late destruction' in some cases, but I could be wrong (I still can't really get my head round the way objects are tied, resulting in more than one call to the classes DESTROY method). > I've created a test script for both of these functions but I am unsure > of the naming scheme? I also assume that going forward we should be > adding test scripts for any changes? It would be nice to have tests for everything we add, and we should certainly try going forward. There are some things I just don't know how to test yet. I'd like to encourage everyone to put tests into the test directory - I've not really got a naming scheme yet, but think something will become obvious once we see some more contributions. For methods, I started numbering at 50, with test names XX_Classname_Methodname.t, but don't know if this will hold up or not. Regards, Rob. |