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

Re: TextEditor highlighter, setting color


On Mon, 22 Dec 2025 at 15:57, Benoît Minisini <
benoit.minisini@xxxxxxxxxxxxxxxx> wrote:

> Le 21/12/2025 à 01:00, Bruce Steers a écrit :
> > I seem to not be able to set TextEditor colors using the
> > Theme[Key].Color property?
> >
> > Public Sub ColorChooser1_Change()
> >
> >    If cmboStates.Text = "Background" Then
> >      TextEditor1.Background = ColorChooser1.Value
> >    Else
> >      TextEditor1.Theme[cmboStates.Text].Color = ColorChooser1.Value
> >    Endif
> >
> >    TextEditor1.Refresh
> >
> > End
> >
> > attached is a simple application that "should" allow changing the
> > highlight modes colors.
> >
> > it seems "reading" TextEditor1.Theme[cmboStates.Text].Color works as the
> > colors show on the ColorChooser when you select a State but writing the
> > property does not seem to do anything on the gambas highlighting?
> >
> > Or am i missing a trick?
> >
> > Respects
> > BruceS
> >
>
> The bug should be fixed in the last commit.
>
> Regards,
>
> --
> Benoît Minisini.


Thanks Benoit but it's still not working here.
not without my workaround.

Public Sub ColorChooser1_Change()

  If cmboStates.Text = "Background" Then
    TextEditor1.Background = ColorChooser1.Value
  Else
    TextEditor1.Theme[cmboStates.Text].Color = ColorChooser1.Value

   TextEditor1.Theme = TextEditor1.Theme.Copy()  ' doesn't work without this

  Endif

  TextEditor1.Refresh

End

Respects
BruceS

Follow-Ups:
Re: TextEditor highlighter, setting colorBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
TextEditor highlighter, setting colorBruce Steers <bsteers4@xxxxxxxxx>
Re: TextEditor highlighter, setting colorBenoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>