[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextHighlighterTheme["Background"] error


On Fri, 11 Apr 2025 at 15:11, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 11/04/2025 à 14:07, Bruce Steers a écrit :
> >
> >
> > On Fri, 11 Apr 2025 at 12:20, Benoît Minisini <benoit.minisini@gambas-
> > basic.org <mailto:benoit.minisini@xxxxxxxxxxxxxxxx>> wrote:
> >
> >     Le 11/04/2025 à 12:40, Bruce Steers a écrit :
> >      > My script editor is now throwing lots of errors.
> >      > It seems everywhere i have used $hTheme["Background"].Color
> >      >
> >      > has the Background theme style been removed?
> >      >
> >      > BruceS
> >
> >     Yes, it's work in progress, but since the last commit it's now
> (almost)
> >     finished.
> >
> >     Now a theme has no background anymore, but a method 'Adapt()' that
> let
> >     the theme adapt to any background you specify.
> >
> >     This method is internally used by the TextEditor control.
> >
> >     So put any background in your text editor, put any theme, and it
> should
> >     work magically.
> >
> >     Regards,
> >
> >     --
> >     Benoît Minisini.
> >
> >
> > can you add an "Adapt" method to the ide that makes all my now broken
> > code work magically?
> > :-\
>
> In the IDE? It's not in the IDE.
>

Sorry that was just a joke, Ie. can you make the IDE fix my now broken
program.



>
> >
> > Or more realistically put the hTheme["Background"].Color back in but
> > make it point to this new magic method so we can still use our
> > previously written code?
> > I have used hTheme["Background"].Color in a fair few programs.
> >
> > BruceS
>
> There is no background anymore in the theme. Nothing can be returned by
> hTheme["Background"] now. Why do you use it? Can't you just remove the
> use of it?
>
> Regards,
>
> --
> Benoît Minisini.


Yes i know Nothing can be returned by hTheme["Background"] now. a bunch of
my programs are broken!

1. My script editor has always had customizable themes. it could set
different color themes including background for all/any filetype/mode.
 I like it as i have different background shades for sh/gambas/html/etc.
 It did this long before gb.higlight by changing the current Styles ad-hoc.
Then I had to re-code things when gb.eval.highlight got dropped for
gb.highlight.
now i have to work out a new way to set the background.
I just tried using TextEditor.Background and it didn't work, only the right
scroll got colored, not the doc.

2. I have answered a question on the forums and here many times and made
entries in the wiki for.. "how do you set TextEditor.Background?",
 the answer was to use Theme["Background"].Color.
 so i guess all those folks also have broken software now?


To be honest writing a program with gambas using gb.form.editor has sucked
a number of times.
Had to re-write a lot to adapt to the change from the old gb.eval.highlight
to the new gb.highlight
Then there was a bug because something like TextHighlighter.CanRewrite
stopped being static.
Then it broke because you removed Theme["Selection"]
Now it's broke because you removed Theme["Background"]

You planning on removing anything else?

I feel i should put a warning on the wiki for gb.form.editor that any
complex code (especially with highlighting) may suddenly break as the
developer changes things.

BruceS

Follow-Ups:
Re: TextHighlighterTheme["Background"] errorBruce Steers <bsteers4@xxxxxxxxx>
References:
TextHighlighterTheme["Background"] errorBruce Steers <bsteers4@xxxxxxxxx>
Re: TextHighlighterTheme["Background"] errorBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: TextHighlighterTheme["Background"] errorBruce Steers <bsteers4@xxxxxxxxx>
Re: TextHighlighterTheme["Background"] errorBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>