Position object under group created through script after cd was opened
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Position object under group created through script after cd was opened
Hey all!
I am trying to position an object directly underneath a group, where the group was created after the card was opened through script. The object seems to be unable to find the group. Is this because it was it was created after the card was opened? Is there something I need to do to have that object find that group?
--
set the bottom of x to the bottom of grp "y"" -- y is a copy of a group that was created after the card was opened.
--
Many thanks in advance!
J.
I am trying to position an object directly underneath a group, where the group was created after the card was opened through script. The object seems to be unable to find the group. Is this because it was it was created after the card was opened? Is there something I need to do to have that object find that group?
--
set the bottom of x to the bottom of grp "y"" -- y is a copy of a group that was created after the card was opened.
--
Many thanks in advance!
J.
Re: Position object under group created through script after cd was opened
Hi,
I see a double quote in the grp name ("y"")
What do you have in x variable, a control name ?
After you posted 10 messages you will may upload your stack and that will be easier for us to help you.
Best regards
Jean-Marc
I see a double quote in the grp name ("y"")
What do you have in x variable, a control name ?
After you posted 10 messages you will may upload your stack and that will be easier for us to help you.
Best regards
Jean-Marc
https://alternatic.ch
Re: Position object under group created through script after cd was opened
Hi.
Not sure how you are doing this, but try an experiment. Create a new stack. make a button with this in its script:
Click on the button.
You have created a new card and new controls, and though not overlaid, which is trivial, all is well. Do I have the sequence correct?
Craig
Not sure how you are doing this, but try an experiment. Create a new stack. make a button with this in its script:
Code: Select all
on mouseUp
create card
create button
set the top of btn 1 to 400
create field
set the top of fld 1 to the bottom of btn 1
end mouseUp
You have created a new card and new controls, and though not overlaid, which is trivial, all is well. Do I have the sequence correct?
Craig
-
- Livecode Opensource Backer
- Posts: 10098
- Joined: Fri Feb 19, 2010 10:17 am
Re: Position object under group created through script after cd was opened
Do you mean:
at a lower layer on the card than the group
or
positioned lower down the card than the group
when you say,
"Position object under group" (my bolding) ?
at a lower layer on the card than the group
or
positioned lower down the card than the group
when you say,
"Position object under group" (my bolding) ?
Re: Position object under group created through script after cd was opened
There are lots of things that *could* be the cause of your problem, but we can't tell for sure what it might be without seeing more of your actual code that creates the group.
One other "speculation" is the one line you showed abovelooks like the error *might* not be in finding the new group "y" but deciding what "x" is. As you have it, LiveCode will first try to interpret x as a variable, since it is not a quoted literal, and does not have an object identifier. Did you maybe? mean something likeIn any event, seeing a bit more of your script would help to find the solution.
One other "speculation" is the one line you showed above
Code: Select all
set the bottom of x to the bottom of grp "y"
Code: Select all
set the bottom of field "x" to the bottom of grp "y"