[Gambas-user] Overriding Color class

Bruce adamnt42 at gmail.com
Sun Oct 18 01:02:38 CEST 2020

On 18/10/20 9:25 am, Benoît Minisini wrote:
> Le 18/10/2020 à 00:49, Bruce a écrit :
>> I have a project that has it's own Color class. It replaces all the 
>> native static properties, e.g. Background with read/write properties, 
>> so we can set a particular color scheme from a file.
>> This has worked since 2017 up to Gambas 3.15.1 without a problem but 
>> now I've updated to the latest git version suddenly I get
>>      Color.Background is incorrectly overridden in class 'Color'
>> Why would this be? I thought local classes had a higher priority in 
>> the symbol table than the native ones? There is no inheritance 
>> involved it is simply a class that should completely replace the ntive 
>> one.
>> tia
>> bruce
> There is actually no "replacement", only inheritance. You must ensure 
> that the new Color.Background property is declared the same way as the 
> old one.
> Regards,
So, this is no longer true:

4.4. Project symbol table
Your project has its own private symbol, like any component, and can 
export any of its classes to the global symbol table by using the EXPORT 
The project classes are loaded after all components. So your exported 
class can override any exported classes declared in any component.


More information about the User mailing list