Hi Steven,
There are two ways you can subclass BrazilMappingForWin32. Both have to be done in the context of an enclosing class:
Newspeak3
'Experiments'
class Mapping usingPlatform: p <Platform> mapping: m <BrazilMappingForWin32> = (
(*Describe the class in this comment.*)
|
SuperBrazilMappingForWin32 = m.
|
) (
public class BrazilMappingForWin32 platform: p = SuperBrazilMappingForWin32 platform: p (
(* Describe the class in this comment. *)
) (
) : (
)
) : (
)
The reason you need the enclosing class is that you cannot create a top level class that subclasses another class, because Newspeak has no global namespace. I would have hoped that the error in your case would be a DNU for BrazilMappingForWin32. We should look into that.
Your real problems begin when you have this class, as there can really only be one such mapping. Newspeak doesn't do singletons, but Windows does :-( ! After all, there is just one display on a PC.
So actually creating an instance of the custom class has to be done when bringing up the platform.
You would have to feed RuntimeForSqueak a manifest object that responded to BrazilMappingForWin32 with your modified version. I think you could do this by mutating NewspeakGlobalState namespace
(i.e.,
NewspeakGlobalState namespace
at: #BrazilMappingForWin32
put: (Mapping usingPlatform: platform mapping: BrazilMappingForWin32) BrazilMappingForWin32 )
and then doing a #resetEverything from the Tools menu. I have not tried it - there may be more to this than meets the eye. Ryan is much more up to date on the details of bootstrap than I am. Have a look at BootstrapManifest and NewspeakGlobalState to see how things get put together.