[Gambas-user] Property override

Leon Davis leondavisjr at ...626...
Thu Apr 27 16:21:47 CEST 2017


Thank you

On Thu, Apr 27, 2017 at 9:14 AM, Tobias Boege <taboege at ...626...> wrote:

> On Thu, 27 Apr 2017, Leon Davis wrote:
> > Using Gambas v3.9.2 and GTK+3
> >
> > I am creating a component and would like to override the Caption
> property.
> >
> >
> >
> > Public Const _Properties as String = "*,Caption"
> >
> > Property Read {Caption} as String
> >
> >
> >
> > Causes an "improper override error". I've also tried encasing the word
> > Caption in the _Properties statement with curly brackets "{Caption}". Any
> > assistance is greatly appreciated.
>
> It depends on *where* you want to override the Caption property, but my
> guess is that Caption is a read-write property in the class you want to
> override. You can't make it read-only by overriding, i.e. the "Read"
> keyword in your "Property Read" declaration causes the error.
>
> Mandatory reading: http://gambaswiki.org/wiki/doc/object-model, which
> exactly states that:
>
>   3.5. Symbol Overriding
>   [...]
>      * A read/write property must be overridden by a read/write property
> with the same datatype.
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list