set the layer of group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
set the layer of group
Hi
I'm trying set the layer (and so hide) a group (consisting of a rounded rectangle and label field) with
"set the layer of the group"grphelp1" to layernumber 3"
and also
"set the layer of the group"id 2075" to layernumber 3"
and neither work.
Any ideas why ?
I'm trying set the layer (and so hide) a group (consisting of a rounded rectangle and label field) with
"set the layer of the group"grphelp1" to layernumber 3"
and also
"set the layer of the group"id 2075" to layernumber 3"
and neither work.
Any ideas why ?
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: set the layer of group
As far as I am aware you CANNOT set the layer of a group.
BUT, if you want to hide a group why not just do this:
or
-
BUT, if you want to hide a group why not just do this:
Code: Select all
set the vis of group "myGuff" to false
Code: Select all
hide group "myGuff"
- Attachments
-
- Groupies.livecode.zip
- Stack.
- (104.42 KiB) Downloaded 45 times
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: set the layer of group
I put my foot in my mouth:
- -
AND I assume it did NOT work with you because you wrote "layernumber 2" instead of just a simple number.
Actually worked fine over here (MacOS 10.7.5, LC 8.1.10).As far as I am aware you CANNOT set the layer of a group.
- -
AND I assume it did NOT work with you because you wrote "layernumber 2" instead of just a simple number.
Re: set the layer of group
Of course you can also set the layer of a group!
But your syntax is wrong! -> ...to layernumber 3
Why not take a quick look into the dictionary to check and be sure?
Hint:
Something like this: ... {layerNumber | top | bottom} shows the available OPTIONS for a command in the dictionary.
And means you can provide a NUMBER or TOP or BOTTOM
Always check the "real world" examples on that page.
But your syntax is wrong! -> ...to layernumber 3
Why not take a quick look into the dictionary to check and be sure?
Hint:
Something like this: ... {layerNumber | top | bottom} shows the available OPTIONS for a command in the dictionary.
And means you can provide a NUMBER or TOP or BOTTOM
Always check the "real world" examples on that page.
Code: Select all
...
set the layer of btn "booboo" to 42
...
## Float above every other control -> highest layer
set the layer of btn "booboo" to TOP
...
## Put it into the "background" -> lowest layer
set the layer of btn "booboo" to BOTTOM
...
Re: set the layer of group
Thanks a lot, guys, a lot of good info there - going to be a great help in future.
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: set the layer of group
Also, you don't need "the" before a control reference.
Only literal strings need quotes, like the names of controls. So when referring to IDs, no quotes are needed.set the layer of group "my Group" to 3
set the layer of group id 12345 to 3
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: set the layer of group
About that "the" thing.
Just because LC forgives the insertion of the completely spurious "the" in many cases is no reason to abuse it. In fact LC simply ignores it, so it is a waste of time, energy and readability to do so. "The" should only be used to identify properties, in one of the precisely two ways to do so:
Craig
Just because LC forgives the insertion of the completely spurious "the" in many cases is no reason to abuse it. In fact LC simply ignores it, so it is a waste of time, energy and readability to do so. "The" should only be used to identify properties, in one of the precisely two ways to do so:
Clean up your acts.Get date()
Get the date
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: set the layer of group
The date is a function.
But yes, use "the" for all properties and some functions if you choose the natural language option instead of the parenthetical version. To make it more confusing, some of the newer functions don't have natural language options, particularly all the mobile functions.
Some people choose parentheses for all functions just to keep things simpler.
There is one notable exception that will get people in trouble if they omit "the" when referring to functions. See "target", where "the target" is a reference to an object, but plain "target" is the text of a field. You can thank the HC team for that one.
But yes, use "the" for all properties and some functions if you choose the natural language option instead of the parenthetical version. To make it more confusing, some of the newer functions don't have natural language options, particularly all the mobile functions.
Some people choose parentheses for all functions just to keep things simpler.
There is one notable exception that will get people in trouble if they omit "the" when referring to functions. See "target", where "the target" is a reference to an object, but plain "target" is the text of a field. You can thank the HC team for that one.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: set the layer of group
That was so freaky I had to try it, and it looks like something LC made more consistent, as this produces two lines with the object reference:
Code: Select all
on openfield
put "target(): "& target() &cr& "the target: "& the target
end openfield
Might be one of those edge cases where Dr Raney looked at HC's syntax and decided to go a slightly different direction.
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
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: set the layer of group
Sloppy.The date is a function.
When pontificating, I must remember also to be correct.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: set the layer of group
@Richard, not quite. Type some text into a field. In the message box: put target. I think that should work, but not at my Mac right now. I confess to only using this variety of target once since I left HC.
If you use parens or "the" you get the same object related function. The dictionary has both terms, though you may need to click the "target" link in the related terms if you get the usual description.
If you use parens or "the" you get the same object related function. The dictionary has both terms, though you may need to click the "target" link in the related terms if you get the usual description.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: set the layer of group
"target" works by itself with no parens?
That's so weird I'm going to pretend I never heard it...
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
-
- VIP Livecode Opensource Backer
- Posts: 9670
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: set the layer of group
Jacque.
"Target" in that scenario will return the name of the card. What else could it guess might be in the mind of the user?
In order to direct "target" to, er, the target, you have to do something where "the target" would return a value for, er, the target of interest.
Like in a "mouseEnter" handler, or whatever. Bullseye.
I think "target", an oldie but goodie, is lovely.
Craig
"Target" in that scenario will return the name of the card. What else could it guess might be in the mind of the user?
In order to direct "target" to, er, the target, you have to do something where "the target" would return a value for, er, the target of interest.
Like in a "mouseEnter" handler, or whatever. Bullseye.
I think "target", an oldie but goodie, is lovely.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: set the layer of group
Look up "target" in the dictionary, there are two entries. One is the function, the other is a keyword. It's the keyword you want. The example in the entry is:
And the summary::answer target
Like I said, it came in handy for something but I can't remember now what it was. I did use it though.Specifies the text contents of the field which was the target of the message currently being handled.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9388
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: set the layer of group
Craig, while you may pontificate from time to time, you do not, unlike someone else hereabouts, do it in a condescending manner.
Anyway, even if we get things wrong, they should serve to stimulate further thought.
Anyway, even if we get things wrong, they should serve to stimulate further thought.