Mantis - tweak
Viewing Issue Advanced Details
1216 Any minor always 05-17-05 06:07 05-17-05 22:30
starbow  
 
normal  
resolved  
fixed  
none    
none  
0001216: CPlayer>>onKeyStroke:signal triggers setupCostume...
I put
self onKeyStroke: #(ctrl 30) signal: #scrollWheel.
into my initialize method, and it calls costume, which calls wearDefaultCostume, which calls setupCostume, which was a problem as I had not finished seting everything up for the setupCostume call. Easily fixed by making the onKeyStroke call the last line of the initialize, but odd never the less

Notes
(0001497)
bert   
05-17-05 12:27   
Actually, it's not odd - everything costume-related should be done in setupCostume, not in initialize. Without a costume you cannot reasonably have keyboard behaviour, so it's notmal that this triggers the costume creation.
(0001500)
starbow   
05-17-05 19:37   
Someone should update the FAQ entry http://tweak.impara.de/ABOUT/FAQ#WidgetBehavior [^]
that tells you to put the onKeyStroke:signal: calls into initialize.
(0001501)
bert   
05-17-05 19:49   
Well, I formulated the above a bit absolute ... it *is* okay to put something like that into initialize - it just happens to trigger the costume creation and invokation of #setupCostume. So only if you actually *have* a #setupCostume method that depends on a finished #initialize you need to care about this. For many players it is just fine to do everything in #initialize.
(0001503)
andreas   
05-17-05 22:30   
Declaring the issue as resolved by fixing the documentation. The FAQ now uses setupCostume instead of initialize.