Re: Challenge: how to set the text of a field

2013-04-08 Thread David Bovill
No Kay - removing the group shows how the internals of LiveCode messaging and target references work in this case, and flags up a warning for anyone who might be working with shared or background groups and behaviors - that's why I include the info in the email. There is no fix for this - however

Re: Challenge: how to set the text of a field

2013-04-08 Thread David Bovill
No Kay - removing the group shows how the internals of LiveCode messaging and target references work in this case, and flags up a warning for anyone who might be working with shared or background groups and behaviors - that's why I include the info in the email. There is no fix for this - however

Re: Challenge: how to set the text of a field

2013-04-07 Thread Kay C Lan
On Sat, Mar 30, 2013 at 5:07 AM, David Bovill wrote: > > Now given you are on the first card - issue the following from the message > box: > > put the card_Number of group 1 of card 3 --> answer is 1 > put the card_Number of group 1 of card 2 --> answer is 1 > put the card_Number of group 1 of c

Re: Challenge: how to set the text of a field

2013-03-30 Thread Peter M. Brigham
if you put a routine in the closefield handler of the field that set a custom property of the group in array form, eg, field_Text[cdNbr], then you can retrieve this at any time from within the group, no matter where it is placed, no? It won't be a setprop/getprop method, but should be pretty str

Re: Challenge: how to set the text of a field

2013-03-30 Thread J. Landman Gay
On 3/30/13 5:54 AM, David Bovill wrote: Tried everything I can think of call, send, value, even the executioncontexts - there is simply no way you can code this in the script of the background (or the groups behavior). makes no difference if it is just a shared group or a background. It comes dow

Re: Challenge: how to set the text of a field

2013-03-30 Thread David Bovill
Thanks Peter - but no it does not help. Lets take your example, but what we want to do is give the group a (virtual) custom property that a developer can call from anywhere in the environment to retrieve the text in the field. You can't hard code anything like you have " fld "f" of card 2" - as you

Re: Challenge: how to set the text of a field

2013-03-30 Thread Peter M. Brigham
Try this: - create a new stack with a button "test" and a field "f" - group them in group "g" - set the backgroundbehavior of group "g" to true - create 2 new cards -- the group will be placed on all 3 cards - put "one" into fld "f" of card 1, "two" into fld "f" of card 2, "three" into fld "f" of

Re: Challenge: how to set the text of a field

2013-03-30 Thread David Bovill
Tried everything I can think of call, send, value, even the executioncontexts - there is simply no way you can code this in the script of the background (or the groups behavior). makes no difference if it is just a shared group or a background. It comes down to the target always referencing the cur

Re: Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
OK - lets rename the challenge :) Same problem - but defining it as follows: - Is it possible to create a handler in the behavior of a shared group that returns the number of the card the shared group is on? This is the same problem - it is a problem of finding a reference to the card a con

Re: Challenge: how to set the text of a field

2013-03-29 Thread Mark Wieder
David Bovill writes: > or if I want a user want to create and index with a script: > > repeat with cardNum = 1 to the number of cards > > put the title_Text of group 1 of card cardNum & CR after myIndex > > end repeat Maybe I'm not following what you want to do here... a custom property of a sh

Re: Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
No joy with the owner - it's a fundamental issue of a reference to the field / group / target - the owner and all references I know of return the value associated with the current card not the value of the actual card the target is on. I view this (and always have as a quite serious bug) - I'm just

Re: Challenge: how to set the text of a field

2013-03-29 Thread Peter Haworth
David, This may not be any less inelegant that parsing the long id, but how having the Title_Text be an array with its keys being either the card number or the card id? On Fri, Mar 29, 2013 at 12:30 PM, David Bovill wrote: > So how can I write a handler to retrun the text of a background group on

Re: Challenge: how to set the text of a field

2013-03-29 Thread J. Landman Gay
On 3/29/13 2:30 PM, David Bovill wrote: So how can I write a handler to retrun the text of a background group on a card other than the current card? The only way I know of is to do some ugly manual parsing of the long id of the target, and so extract the card id and construct a reference that wa

Re: Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
OK - let's be more descriptive - this card and the current card won't work. Let's picture an application - say it's a keynote style presentation stack - and we are creating background groups that a user can place in the presentation. Say the presentation has 10 cards and all of them happen to use t

Re: Challenge: how to set the text of a field

2013-03-29 Thread J. Landman Gay
On 3/29/13 1:44 PM, Mark Wieder wrote: David Bovill writes: That is the issue - there is no "easy" way of finding out the value of from within the behavior. There is a way - but it is both unreliable and very ugly. Wandering if anyone has a simple reliable technique I've missed? the curren

Re: Challenge: how to set the text of a field

2013-03-29 Thread Mark Wieder
David Bovill writes: > > That is the issue - there is no "easy" way of finding out the value of > from within the behavior. There is a way - but it is both > unreliable and very ugly. Wandering if anyone has a simple reliable > technique I've missed? the currentcard of this stack -- Mark Wi

Re: Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
That is the issue - there is no "easy" way of finding out the value of from within the behavior. There is a way - but it is both unreliable and very ugly. Wandering if anyone has a simple reliable technique I've missed? On 29 March 2013 16:51, J. Landman Gay wrote: > > get the text of fld "titl

Re: Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
Thanks Scott - yes you can do that - so for instance: getprop title_Text [cardNum] > return the text of fld 1 of group "Test" of card cardNum > end title_Text > > setprop title_Text [cardNum] someText >set the text of fld 1 of group "Test" of card cardNum to someText > end title_Text > wo

Re: Challenge: how to set the text of a field

2013-03-29 Thread J. Landman Gay
On 3/29/13 4:08 AM, David Bovill wrote: OK - a very basic challenge for all you LIveCode wizz kids out there :) How do you set the text of a field. The twist is you need to do it for a group which has been placed on multiple card, so there is the text on card 1 and this is different from the text

Re: Challenge: how to set the text of a field

2013-03-29 Thread Scott Rossi
This problem is based on the same issue that Pete Haworth ran into: references to controls within groups placed on multiple cards resolve to the current card. Not sure if this would be an option for you, but you could use commands in the behavior instead of set/getProp and include the card number

Challenge: how to set the text of a field

2013-03-29 Thread David Bovill
OK - a very basic challenge for all you LIveCode wizz kids out there :) How do you set the text of a field. The twist is you need to do it for a group which has been placed on multiple card, so there is the text on card 1 and this is different from the text on card 2. The difficulty is that you wan