Setting a hilitecolor

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

Post Reply
andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Setting a hilitecolor

Post by andyh1234 » Sun Sep 23, 2007 3:46 pm

I have some code than works as follows:

set the hiLiteColor of me to 180,180,180

It works on a text field, and works well, however I cannot figure out how to put the color back to the default 'empty' state.

Ive tried

set the hiLiteColor of me to empty

but that doesnt work. Any ideas?

Andy

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sun Sep 23, 2007 4:21 pm

Hi Andy,

that's the correct code:
set the hiLiteColor of me to 180,180,180

Maybe the inherited hilitecolor of the group/card/stack ist exactly the same (180,180,180) so you don't see a difference?


Best

Klaus

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Sun Sep 23, 2007 5:36 pm

The problem Im having is actually trying to get rid of the hilitecolor after ive set it.

To explain exactly what Im trying for, on the mac version of my appliction the hilitecolor works well, but when I compile for windows its looks horrible.

Id like to keep it in Mac version, and leave it 'empty' it in Windows so it just picks up the default system setting, but because I work on a mac, everytime I load the card in the development environment, the code sets the hilitecolour.

I was going to use some code like

If the platform is "MacOS" then
set the hiLiteColor of me to 180,180,180
else
set the hiLiteColor of me to empty
end if

But... The code sets the color fine, but the empty line doesnt work.
At the moment ive had to just disable the block so I dont keep having to empty the hilitecolor property in the inspector before I compile for windows, but if possible id really like to be able to do it all in code so I can develop on the mac and not worry if its setting the hilitecolor to something else, and let the code put it back which it runs on windows.

Any ideas?

Thanks

Andy

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Sun Sep 23, 2007 6:27 pm

Hi Andy,

## ...and leave it 'empty' it in Windows so it just picks

Ah, in that case you could try this:

Code: Select all

If the platform is "MacOS" then 
  set the hiLiteColor of me to 180,180,180 
else 
  set the hiLiteColor of me to the hilitecolor 
end if 
From the docs:
"By default, the global hiliteColor property is set to the system highlight color."

At least worth a try :-)


Best

Klaus

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Sun Sep 23, 2007 8:39 pm

Thanks Klaus, ill give it go!

Andy

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Post by andyh1234 » Sun Sep 23, 2007 8:42 pm

Thanks again Klaus, that worked well, not something I would have though of.

Andy

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Mon Sep 24, 2007 8:33 am

Hi Andy,

well, after using MetaCard/Revolution for over 8 years now I think I HAVE to know some of these more esoteric facts ;-)


Best

Klaus

Post Reply