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

Re: TextHighlighterTheme["Background"] error


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

> Le 11/04/2025 à 18:29, Bruce Steers a écrit :
> >
> >
> > On Fri, 11 Apr 2025 at 16:28, Bruce Steers <bsteers4@xxxxxxxxx
> > <mailto:bsteers4@xxxxxxxxx>> wrote:
> >
> >     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
> >
> >
> > okay , simmering down.  I've got it working again now with the new Adapt
> > function.
> >
> > I put a warning on the wiki..
> > WARNING!!
> >
> > TextEditor is primarily the gambas IDE text editor and is subject to
> > changes at any time without warning.
> > Particularly when it comes to Highlighting (gb.highlight)
> >
> > I have had to re-code my own program that uses TextEditor 3 times due to
> > fundamental changes in how highlighting works.
> >
> > BruceS
> >
>
> This is the development version, this is work in progress.
>
> Note that I made no guarantee about the style name of the themes. All
> what on you said on the forum were your assumptions, even if they seem
> logical.
>


> If I understand what you wrote correctly, you use the background color
> of the editor to make the distinction between the file types, the
> "Background" style of the theme being used by the TextEditor instead of
> its background color.
>
> But:
>
> - I found no good reason why the background of the editor should not be
> prioritary.
>
> - I wanted to avoid the problem I see elsewhere of having to write
> themes twice, for light and for dark backgrounds.
>
> Sorry if it broke your programs, but it's difficult to be
> backward-compatible with that subject, especially if, as I said before,
> I made no guarantee about the style names. They are entirely dynamic.
>
> Maybe I can implement a mandatory default "Background" style in the
> themes. If you set its color, it is registered, and if the TextEditor
> sees it, it will use it instead of its background color.
>
> I will see what I can do...
>
> --
> Benoît Minisini.


Do whatever makes you happy.
I've already worked around it in one program converting...
hEditor.Theme["Background"].Color = $iCol
 to
hEditor.Background = $iCol
hEditor.Theme.Adapt($iCol)

And i'll not tell anyone that's how to do it, as it is just a
non-guaranteed assumption apparently.

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