[Pharo-project] adding traits programatically
Hi, I'm trying to add/remove traits from a class programatically and I have a problem... What I'm doing is, for instance: NSProxy traitCompostition: TNSLogConsole. and NSProxy traitComposition: TNSLogNone. (as a way to replace logging strategies)... but nothing happens... bah... in the browser the class definition is affected, but the application still works as if none changed... do I need to force a class recompilation after changing trait composition? what I'm doing wrong? Cheers, Esteban
Hi Esteban, traitComposition: is a low level method that should not be accessed. I believe that #setTraitComposition: is what you're looking for: NSProxy setTraitComposition: {TNSLogConsole} asTraitComposition Cheers, Alexandre On 11 Feb 2010, at 11:11, Esteban Lorenzano wrote:
Hi, I'm trying to add/remove traits from a class programatically and I have a problem... What I'm doing is, for instance:
NSProxy traitCompostition: TNSLogConsole.
and
NSProxy traitComposition: TNSLogNone.
(as a way to replace logging strategies)... but nothing happens... bah... in the browser the class definition is affected, but the application still works as if none changed... do I need to force a class recompilation after changing trait composition? what I'm doing wrong?
Cheers, Esteban
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
participants (2)
-
Alexandre Bergel -
Esteban Lorenzano