Richard Frith-Macdonald wrote: > Author: rfm > Date: Mon Jan 5 10:43:25 2009 > New Revision: 27518 > > URL: http://svn.gna.org/viewcvs/gnustep?rev=27518&view=rev > Log: > Some moves towards making scrollers more themable > > Modified: > libs/gui/trunk/ChangeLog > libs/gui/trunk/Headers/Additions/GNUstepGUI/GSTheme.h > libs/gui/trunk/Source/GSTheme.m > libs/gui/trunk/Source/GSThemeDrawing.m > libs/gui/trunk/Source/NSButtonCell.m > libs/gui/trunk/Source/NSScroller.m >
Hi Richard, only now did I get around to have a look at your changes for theming. And it seems like I don't understand what you are doing and perhaps a bit of explanation might help here. And please remember that I am language challenged and you will have to be careful not to misunderstand what I write, just because I cannot express myself well enough :-) Specifically I looked into the code for scrollers and just don't get it. First there are those new methods on GSTheme that return the different cells for the parts of the scroller. Fine, but why do we sometimes (cellForScrollerKnob) return non-autoreleased elements here? Isn't this bound to cause a memory leak? Probably just a bug? Next there is this method [setName:forElement:], it gets called three times for each element in NSScroller. Twice in drawParts first to unset and then to set the element name. As far as I can understand the code the elements should all be nil for the first call, why make this call (that gets ignored in GSTheme) at all? That method also gets called in dealloc, now all NSScrollers share the same drawing parts, when it is possible to unset these values when one scroller is deallocated, do we really need to store them? What I could understand is the theme keeping an internal track of the cells returned for specific elements. I don't see a good example for this at the moment, as the theme could already prepare the elements well enough for what ever is needed later on, but you never know what specific themes may require. That way all the methods on GSTheme that return specific drawing elements first store them in the names dictionary with the name of the purpose these elements are created for. I hope this makes sense and sorry if I totally missed what you are doing. Fred _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org http://lists.gnu.org/mailman/listinfo/gnustep-dev