Having script editor with a black background...

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Having script editor with a black background...

Post by Mag » Fri Jan 13, 2017 10:58 pm

...and be a le to see the text. It's not possible right? 8)

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Having script editor with a black background...

Post by jmburnod » Fri Jan 13, 2017 11:10 pm

Hi Mag,
What about menu livecode->Preferences->script editor
Best
Jean-Marc
https://alternatic.ch

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Fri Jan 13, 2017 11:17 pm

Hi Jean-Marc, I tried but then I can't see some parts of the text. Is there a way to change the text color? In my preferences I see only two variants in the Colorization pop up menu: Default and Revolution Classic... :oops:

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Having script editor with a black background...

Post by richmond62 » Sat Jan 14, 2017 9:11 am

I've just spent a fruitless 30 minutes trying to mess around with the "revPreferencesGUI" stack in LiveCode 8.1.2:

trying to give the Colorization dropDown button a fourth item ('White'), but, as LiveCode is now made in a "different way"
to get that hack to stick is well-nigh impossible.

I was also unable to locate the script that would activate on the menuPick from that button.

Certainly a white/grey/pale yellow/pale blue schema on a black background would seem a good option.

Probably the best way to get this sort of thing is to go "cap in hand" to the LiveCode people themselves.

It does seem odd that the preferences GUI allows us to choose a black background for the script editor but no
textColor that will sit nicely with that.

Here's my personal fantasy:
newEditor.png
Unfortunately this is only a fantasy knocked together using GIMP.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Sat Jan 14, 2017 11:22 am

Hi Richmond, I like so much your schema. I would use it all day! :D


And for comments maybe green...

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Having script editor with a black background...

Post by AndyP » Sat Jan 14, 2017 11:27 am

Hi Richmond .. you can have your fantasy come true :D

http://2108.co.uk/script-editor-themer/
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Sat Jan 14, 2017 11:52 am

Very interesting, I wonder if it works with macOS Sierra and LiveCode 8.1.2

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Having script editor with a black background...

Post by Mikey » Sat Jan 14, 2017 2:11 pm

SET is ok, glx2 works (but is slow), but I've taken to using atom when I have something long to work on, and I use the dark theme when I do.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Having script editor with a black background...

Post by [-hh] » Sun Jan 15, 2017 12:00 am

EDIT: There is a simpler one-click-solution for that technique that doesn't touch any system file, see below: http://forums.livecode.com/viewtopic.ph ... 26#p150426


This is of course not comparable with the possibilities of Andy's utility, but you can have kind of that in LC 8/9 by one line:

[1] Go in the contents of your LC 8/9 application to (*)
     Tools/Toolset/palettes/script editor/behaviors
[2] Open file revseeditorbehavior.livecodescript with a text editor
[3] Make the file writable (**) and insert as line 159:
     set the ink of field "Script" of me to "notSrcCopy"
[4] Save the file and restart LiveCode

And similar in LC 6/7:

[1] Go in the contents of your LC 6/7 application to (*)
     Tools/Toolset/palettes/
[2] Copy revscripteditor.rev to Desktop or Documents and
     open the stack with LC 6.7.11 (7.1.4)
[3] Edit script of btn "Template Editor"
     Sort handlers by order "order-of-appearance" (in preferences).
[4] In command initialize insert as line 120:
     set the ink of field "Script" of me to "notSrcCopy"
[5] Save the stack and replace the original with it
    (you will probably asked for your admin password to allow that)
    and restart LiveCode

----------------
(*) On MacOS rightClick the app's icon and choose show Contents.
On Win rightClick the app's icon and choose show location.
On Linux it's in ~/.runrev/components/<app folder>
(**) Option A: On MacOS use TextWrangler, on Win Notepad++, on Linux the default textEditor. Change the file and save. The textEditor will save without asking or ask if you wish to make the file writable (if it isn't). Option B: Drag the file to the desktop, change it and drag it back. You will be asked for your admin password for replacing if the file isn't writable. Option C: Use the commandLine (chmod +w ...)

----------------
Use moreover Preferences/ScriptEditor:
You can still set the colorization (Richmond's example is at about Revolution classic).
And you can set the backgroundColor, but remember: it becomes "_not_ the color".

(As a system selection color I use with Richmond's example then cyan ("0,255,255"). This yields with that ink a bright red for the script editor textselection.
Another option that works here for both color themes and also black on white in other apps: Choose as system selection color "skyblue" ("118,212,255") what yields a kind of "cayenne" for the script editor.)
Attachments
scriptEditorExample1.png
ink "notSrcCopy", colorization "Revolution classic",
system selection color "skyblue" ("118,212,255"),
Preferences/backgroundColor white (yields black).
scriptEditorExample2.png
ink "notSrcCopy", colorization "Default",
system selection color "skyblue" ("118,212,255"),
Preferences/backgroundColor white (yields black).
Last edited by [-hh] on Fri Jan 27, 2017 4:43 am, edited 2 times in total.
shiftLock happens

AndyP
Posts: 614
Joined: Wed Aug 27, 2008 12:57 pm
Location: Seeheim, Germany (ex UK)
Contact:

Re: Having script editor with a black background...

Post by AndyP » Mon Jan 16, 2017 1:09 pm

A new version (2.2) of Script Editor Themer has been released.

Release notes can be viewed here.

http://2108.co.uk/script-editor-themer/ ... ase-notes/

Now works with Community and Commercial versions of LiveCode

This version fixes the problems with V8 onwards.

Existing customers should receive an email with update instructions.
Andy Piddock
https://livecode1001.blogspot.com Built with LiveCode
https://github.com/AndyPiddock/TinyIDE Mini IDE alternative
https://github.com/AndyPiddock/Seth Editor color theming
http://livecodeshare.runrev.com/stack/897/ LiveCode-Multi-Search

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Having script editor with a black background...

Post by [-hh] » Tue Jan 17, 2017 3:30 pm

EDIT: There is a simpler one-click-solution for that technique that doesn't touch any system file, see below: http://forums.livecode.com/viewtopic.ph ... 26#p150426

Let me change the one-liner from above to a three-liner, that yields a simple theme-switcher for this simplest solution.
This works (tested) on Mac/Win/Linux in LC 8/9. You don't have to restart LiveCode for a switch, just close and reopen the script editor.

In "script editor/behaviors/revseeditorbehavior.livecodescript"
insert at line 159:

Code: Select all

   if 254 is among the items of sePrefGet("editor,backgroundcolor")
   then set the ink of field "Script" of me to "notSrcCopy"
   else set the ink of field "Script" of me to "srcCopy"
This "generates" dark themes simply by choosing a backgroundColor with one of the values is 254 (dec 254 = hex FE), for example "254,255,255" or "#FEFEFE".
This yields then, by the ink, a black background (visible as "1,0,0") and everything has fine contrast on that black.

White and "custard yellow" are not one of these 254-switches. So choosing one of these in the preferences takes one back to the light theme.
Last edited by [-hh] on Fri Jan 27, 2017 4:43 am, edited 1 time in total.
shiftLock happens

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Tue Jan 17, 2017 3:39 pm

Hi hh, unfortunately, when I try your hack in LC under the Mac, I get a Gatekeeper error: the app can't open because it's damaged. :(

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Having script editor with a black background...

Post by [-hh] » Tue Jan 17, 2017 5:13 pm

Hi Mag,

I have no problems on MacOS 10.12. How did you change the file?

hh
shiftLock happens

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Tue Jan 17, 2017 5:59 pm

I tested with LiveCode Beta 4,opened the pakaged and located the file, opened the file with Text Wrangler, it asked me if I want make the file unlocked, pasted the lines and then saved the file.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Having script editor with a black background...

Post by Mag » Tue Jan 17, 2017 6:02 pm

BTW, this bug report about colorization of the script editor, has also new info:
http://quality.livecode.com/show_bug.cgi?id=7901

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”