TextEditor background

Post

Posted
Rating:
#1 (In Topic #456)
Guru
BruceSteers is in the usergroup ‘Guru’
Anyone know how to change the TextEditor controls background colour?

Setting the .background property seems to change the background behind the editor view but its main background colour remains white?

Cheers <EMOJI seq="1f642" tseq="1f642">🙂</EMOJI>
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
cage is in the usergroup ‘Regular’
 Bruce the only way I have been able to change the background was to use GTK.  Although some of my programs have had problems using it.  You may not run into that problem so give it a try.

Update:
Was playing around and found GTK does not work either.  However I tried the QT4 to QT5 switcher and was able to change the background.  Hope that helps/
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
 Thanks cage , i tried with all combinations of gtk 2 & 3 and qt 4 & 5 and gb.gui the switcher , nada.

I might add it to the bugtracker..
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
All praise the great Benoît :)
In case anyone wanted the solution..

Code (gambas)

  1. TextEditor1.Styles[Highlight.Background].Color = iColor
  2.  

EDIT:
Now TextEditor.Styles is replaced by TextEditor.Theme and String keys not constants.

Code (gambas)

  1. TextEditor1.Theme["Background"].Color = iColor
  2.  


There's many other highlight options too.
Pretty sure i can add to the wiki.
Will try to add some info about the TextEditor to it.
apparently gotta learn the wiki syntax first so here we go, wish me luck ;) lol

Edit.  Wasn't too much to it so i've added info about setting Background colour and pointed to the other Highlighting options on the main gambas wiki TextEditor page.

http://gambaswiki.org/…gb.form.editor/texteditor
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Regular
cage is in the usergroup ‘Regular’
Glad you solved the problem.  Yes post all you can find out about it.  :D
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
 It is the old GB.eval.highlight. now depreciated.

Use gb.highlight now and TextEditor.Theme
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
 In a recent commit Benoit has removed this long used highlight/theme method and has now made TextEditor.Background work as expected.

So now the following is wrong and will error.
TextEditor1.Theme["Background"].Color = iColor

but this should work as expected…
TextEditor1.Background = iColor
Online now: No Back to the top
1 guest and 0 members have just viewed this.