[Gambas-user] new font class behavior is broken
Benoit Minisini
gambas at ...1...
Sun Apr 4 17:30:42 CEST 2004
On Saturday 03 April 2004 19:18, Rob wrote:
> According to the changelog for 0.92,
>
> "The Font class became a true class. Consequently,
> Control.Font.Bold = TRUE does not change the control font
> anymore. You must use an intermediate Font variable:
> DIM hFont as Font
> hFont = MyControl.Font
> hFont.Bold = TRUE
> MyControl.Font = hFont"
>
> You could already dim hFont as Font, so I don't understand why it
> wasn't a "true class" before, and why we need this new,
> cumbersome syntax now. There are lots of other instances when
> non-virtual classes can be used as virtual if they're returned
> as a property value, and I don't see Control or Picture as not
> being "true" classes for example.
>
> What is the underlying reason for this change? And wasn't this
> supposed to just be a bug fix release, anyway?
>
> Rob
>
To allow Control.Font.Bold = TRUE changing the control font in Gambas AND
Control.Font returning a Font object, I had to implement a special support in
the class routines of the interpreter. And the Font class was the sole one in
this case !
So I decided to remove this exception, because it allows me to have faster
referencing/deferencing routines.
I acknowledge that the syntax become a bit complicated. Maybe I will add
methods to allow the following:
MyControl.Font = MyControl.Font.SetBold(TRUE)
Regards,
--
Benoit Minisini
mailto:gambas at ...1...
More information about the User
mailing list