Can controls be de-activated, ie., grayed out?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 2
- Joined: Sat Aug 31, 2013 2:05 am
Can controls be de-activated, ie., grayed out?
It's a pretty common UI tactic to gray controls that are inactive so they are visible but clearly not usable, but I can only see the option to hide controls like buttons or fields. Am I missing something?
Re: Can controls be de-activated, ie., grayed out?
HI murphy,
1. welcome to the forum!
2. You can always DIS- or ENABLE controls:
...
disable btn "my button"
enable bnt "my button"
## etc...
...
That is a shortcut for setting the ENABLED/DISABLED property:
...
set the enabled of btn "my button" to TRUE
set the disabled of btn "my button" to FALSE
## etc...
...
Here some great learning resources for this (and more!) kind of stuff:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
1. welcome to the forum!

2. You can always DIS- or ENABLE controls:
...
disable btn "my button"
enable bnt "my button"
## etc...
...
That is a shortcut for setting the ENABLED/DISABLED property:
...
set the enabled of btn "my button" to TRUE
set the disabled of btn "my button" to FALSE
## etc...
...
Here some great learning resources for this (and more!) kind of stuff:
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: Can controls be de-activated, ie., grayed out?
Hi murphycoverdot2001 and welcome to the forum - you can enable and disable controls, either in the inspector or by code using something like this:
EDIT: that speedy Klaus beat me to it again! 
Code: Select all
set the enabled of btn "btnTest" to false --disables
set the enabled of btn "btnTest" to true --enables

"...this is not the code you are looking for..."
-
- Posts: 2
- Joined: Sat Aug 31, 2013 2:05 am
Re: Can controls be de-activated, ie., grayed out?
Never mind, I found the disabled property/disable command. All is good now. And now I see that Klaus was straightening me out, too. Thanks, Klaus.
FWIW, I tried googling livecode contorl inactive and came up with nothing relevant. It's always fun trying to guess the search terms that will get the goog to divulge her knowledge...
FWIW, I tried googling livecode contorl inactive and came up with nothing relevant. It's always fun trying to guess the search terms that will get the goog to divulge her knowledge...
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Can controls be de-activated, ie., grayed out?
Google is sometimes better than others. When I run that same search I get this forum link as the second hit, in which the first post there includes an example of disabling buttons:murphycoverdot2001 wrote:FWIW, I tried googling livecode contorl inactive and came up with nothing relevant. It's always fun trying to guess the search terms that will get the goog to divulge her knowledge...
http://forums.livecode.com/viewtopic.php?f=8&t=5825
The team is revising the docs to include tags, which will greatly enhance their searchability. In the meantime, we have these forums for any edge cases where the synonyms we're looking for don't show up readily in other search engines.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Can controls be de-activated, ie., grayed out?
I never use Google to find links or topics, preferring rather to search within the use-list or the forum directly. I suppose new users choose this path because it is second nature to do so with all questions on all subjects generally.
I just wonder if it is important to make sure that such queries are ALWAYS directed to one of the two venues? We want a well attended, centralized discussion, er, forum, (or two) because these are best suited to provide answers. The community will grow, and many lost souls will find solace; hardly anyone is left without resolution here, whereas in the world at large, who knows how many have simply met a dead end and gone away?
If tags can be weighted so that searches of any general kind would point to the forum (my favorite venue), I bet we would see a lot more newbie activity.
Craig Newman
I just wonder if it is important to make sure that such queries are ALWAYS directed to one of the two venues? We want a well attended, centralized discussion, er, forum, (or two) because these are best suited to provide answers. The community will grow, and many lost souls will find solace; hardly anyone is left without resolution here, whereas in the world at large, who knows how many have simply met a dead end and gone away?
If tags can be weighted so that searches of any general kind would point to the forum (my favorite venue), I bet we would see a lot more newbie activity.
Craig Newman