put object in background ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
put object in background ?
I want to have a scrolled field list on each card.
Do I have to copy it, or is there a way to put it in the background,
so it has not to be copied and it is also visible on each card.
Do I have to copy it, or is there a way to put it in the background,
so it has not to be copied and it is also visible on each card.
Re: put object in background ?
Hi Rob,
You can group just the list field and set the group to behave like background.
Now you know the same content will show up on each card right?
Simon
You can group just the list field and set the group to behave like background.
Now you know the same content will show up on each card right?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: put object in background ?
I did so, but yes, the field is on each card, but content NO.
So I try something else.
And BTW, when I select all to group it, nothing happens until I remove the scrollfield.
And when I create a new scrollfield there is the same problem,
There is no selectedtext anymore , so the field does not what it used to do.
another question:
In the stackscript I wrote:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
So when I create a new card, this script makes it impossible.
I want to keep the script before a newcard is made with:
set the clipboardData["text"] to script of this stack
BUT HOW TO EMPTY THE STACKSCRIPT ??
So I try something else.
And BTW, when I select all to group it, nothing happens until I remove the scrollfield.
And when I create a new scrollfield there is the same problem,
There is no selectedtext anymore , so the field does not what it used to do.
another question:
In the stackscript I wrote:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
So when I create a new card, this script makes it impossible.
I want to keep the script before a newcard is made with:
set the clipboardData["text"] to script of this stack
BUT HOW TO EMPTY THE STACKSCRIPT ??
Re: put object in background ?
forget this, my fault, wrong fieldI did so, but yes, the field is on each card, but content NO.
So I try something else.
And BTW, when I select all to group it, nothing happens until I remove the scrollfield.
And when I create a new scrollfield there is the same problem,
There is no selectedtext anymore , so the field does not what it used to do.
another question:
In the stackscript I wrote:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
So when I create a new card, this script makes it impossible.
I want to empty and keep the script before a newcard is made with:
set the clipboardData["text"] to script of this stack
BUT HOW TO EMPTY THE STACKSCRIPT ??
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: put object in background ?
robm80 wrote:BUT HOW TO EMPTY THE STACKSCRIPT ??
Code: Select all
set the script of stack "StackName" to empty
Going back to the original goal of having a field present on each card, in addition to putting it into a shared group you can also turn on the sharedText property for the field, and then its text contents will be shared across every card its present on.
What's happening there that you don't want?robm80 wrote: question:
In the stackscript I wrote:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
So when I create a new card, this script makes it impossible.
The clipboard belongs to the user. They have have data on it from other applications unrelated to yours, so it should only be overwritten when the user explicitly requests it with Edit->Copy.I want to keep the script before a newcard is made with:
set the clipboardData["text"] to script of this stack
If you just need a container use a variable.
But in this case, we're looking at self-modifying code, which is usually much more complex than is needed.
Forgive me if I missed something obvious in the earlier posts, but if you can describe what you want to achieve here I'll be we can come up with a relatively simple solution quickly for you.
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: put object in background ?
my menuscript:
on menuPick pItemName
switch pItemName
case "noscript"
set the script of stack "PK" to empty ---> does not work
put script of this stack into vStack ---> how to declare vStack as an varaible
break
case "yesscript"
put vstack into script of me ---> for the time the script is not empty, I can't see if it works
break
end switch
end menuPick
again" what I want is to create a new card, but that is stopped by the stackscript:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
so I made this menu to empty the script, while creating new cards.
on menuPick pItemName
switch pItemName
case "noscript"
set the script of stack "PK" to empty ---> does not work
put script of this stack into vStack ---> how to declare vStack as an varaible
break
case "yesscript"
put vstack into script of me ---> for the time the script is not empty, I can't see if it works
break
end switch
end menuPick
again" what I want is to create a new card, but that is stopped by the stackscript:
on opencard
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end opencard
so I made this menu to empty the script, while creating new cards.
Re: put object in background ?
Hi Rob,
I'm not seeing it.
How is this different?
Simon
I'm not seeing it.
How is this different?
Simon
- Attachments
-
- Untitled 1.zip
- LC 6.5
- (595 Bytes) Downloaded 196 times
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: put object in background ?
Hi Rob,
why not just put this into the stackscript and leave tha card scripts empty?
Best
Klaus
why not just put this into the stackscript and leave tha card scripts empty?
Code: Select all
on opencard
if there is a field "pagnum" then
put the number of this card && "of" && the number of cards of this stack-1 into field "pagnum"
end if
end opencard

Best
Klaus
Re: put object in background ?
Hi Klaus,
thanks very much; this is the trick:
I looked in the dictionary and the tutorials, but something simple as this, could not be found.
Anyway, my testcase is ready and runs, but for at least 40% with all the help I got.
thanks again
Rob
thanks very much; this is the trick:
but the real thing is : where will I find this syntax?if there is a field "pagnum" then
I looked in the dictionary and the tutorials, but something simple as this, could not be found.
Anyway, my testcase is ready and runs, but for at least 40% with all the help I got.
thanks again
Rob
Re: put object in background ?
Dag Rob,
How would you solve this logical problem WITOUT a computer and Livecode?
If you can explain the problem to yourself in your own words, you can translate it to Livecode almost 1:1!
Best
Klaus
this is not a question of syntax in the first place, it is about LOGICS!robm80 wrote:Hi Klaus,
thanks very much; this is the trick:but the real thing is : where will I find this syntax?if there is a field "pagnum" then
How would you solve this logical problem WITOUT a computer and Livecode?
If you can explain the problem to yourself in your own words, you can translate it to Livecode almost 1:1!
Best
Klaus
Re: put object in background ?
Klaus is right, you do need a bit of logic to find it. Usually thinking of how you'd ask the question in plain English will get you close to the term you're looking for. Then look at the "see also" entries to find out what else is available. For example, you probably got an error about "no such object" or "object can't be found," so I might realize that I need to check if an object exists before trying to work with it. So I would look up "exist" -- and there it is. In the "see also" section it lists "there is a" also. In this case, either term would work.robm80 wrote: but the real thing is : where will I find this syntax?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: put object in background ?
I agree with "logics" and I found in the lessons a "see also" with 95 articles, but I did not get any answer for these questions:
In the pulldown menu I wrote:
on menuPick pItemName
switch pItemName
case"naam"
put empty into fld "pagnam"
ask "welke naam"
set text of field "pagnam" of cd "PK"to it
break
case "kaart"
get text of field "pagnam" of cd "PK"
if fld "inhoud" is not empty
then put cr&it after fld "inhoud"
else
put it&cr after fld "inhoud"
end if
sort lines of field "inhoud" of cd "PK"
create card it[/color]
set the backgroundcolor of this card to white ---> error: compilation error at line 17 (Expression: unquoted literal), char 43; char 43 is the i in "white"
set text of field "pagnam" of this card to text of field "pagnam" of cd "PK"
sort lines of field "inhoud" of this card
break
case "verwijder"
get text of field "pagnam" of cd "PK"
delete cd it
put lineoffset(it,field "inhoud" of cd PK) into tLine ---> error: compilation error at line 24 (Expression: unquoted literal), char 44; char 44 is the i in "into"
if tLine <> 0 then
delete line tLine of field "inhoud" of cd PK
break
end if
end switch
end menuPick
I don't understand these errors even not with logic thinking, nor tells "see also" anything about these errors.
Or do you have another "see also" ?
In the pulldown menu I wrote:
on menuPick pItemName
switch pItemName
case"naam"
put empty into fld "pagnam"
ask "welke naam"
set text of field "pagnam" of cd "PK"to it
break
case "kaart"
get text of field "pagnam" of cd "PK"
if fld "inhoud" is not empty
then put cr&it after fld "inhoud"
else
put it&cr after fld "inhoud"
end if
sort lines of field "inhoud" of cd "PK"
create card it[/color]
set the backgroundcolor of this card to white ---> error: compilation error at line 17 (Expression: unquoted literal), char 43; char 43 is the i in "white"
set text of field "pagnam" of this card to text of field "pagnam" of cd "PK"
sort lines of field "inhoud" of this card
break
case "verwijder"
get text of field "pagnam" of cd "PK"
delete cd it
put lineoffset(it,field "inhoud" of cd PK) into tLine ---> error: compilation error at line 24 (Expression: unquoted literal), char 44; char 44 is the i in "into"
if tLine <> 0 then
delete line tLine of field "inhoud" of cd PK
break
end if
end switch
end menuPick
I don't understand these errors even not with logic thinking, nor tells "see also" anything about these errors.
Or do you have another "see also" ?
Re: put object in background ?
The "unquoted literal" is the clue
Just like in the dictionary
set the backgroundcolor of this card to "white"
and then this
put lineoffset(it,field "inhoud" of cd "PK") into tLine
You have it right (edit: almost) everywhere else
Simon
Just like in the dictionary
set the backgroundcolor of this card to "white"
and then this
put lineoffset(it,field "inhoud" of cd "PK") into tLine
You have it right (edit: almost) everywhere else

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: put object in background ?
Sorry, don't understand.and then this
put lineoffset(it,field "inhoud" of cd "PK") into tLine
You have it right (edit: almost) everywhere else
After I had quoted "white", there was no error anymore.
Re: put object in background ?
Please tell me what's wrong with this (Klaus) line; it makes the pulldownmenu strikesput lineoffset(it,field "inhoud" of cd PK) into tLine ---> error: compilation error at line 24 (Expression: unquoted literal), char 44;