Saving stack locations in multi monitor setups

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving stack locations in multi monitor setups

Bob Sneidar via use-livecode
Hi all. Here is a handy snippet for saving a stacks location, which is multi-monitor aware. It creates an array of key value pairs for any monitor resolution a stack is in when this function is called. The key is the monitor resolution and the value is the loc of the stack passed as pTargetStack. pTargetStack must be the stack name, or else the long stack name. In other words it must begin with the word "stack".

I have gotten into the habit of always using long stack names and long IDs to deconflict multiple objects with the same names.

on saveStackLocation pTargetStack
   put the stackloc of pTargetStack into aStackLoc
   put line (the screen of stack pTargetStack) of the screenRects into tScreenRect
   put item 3 of tScreenRect - item 1 of tScreenRect into item 1 of tRect
   put item 4 of tScreenRect - item 2 of tScreenRect into item 2 of tRect
   put the loc of pTargetStack into aStackLoc [tRect]
   set the stackloc of pTargetStack to aStackLoc
end saveStackLocation

function getStackLocation pTargetStack
   put the stackloc of pTargetStack into aStackLoc
   put line (the screen of stack pTargetStack) of the screenRects into tScreenRect  
   put item 3 of tScreenRect - item 1 of tScreenRect into item 1 of tRect
   put item 4 of tScreenRect - item 2 of tScreenRect into item 2 of tRect
   return aStackLoc [tRect]
end getStackLocation


So on closeStack call this function and on openStack call getStackLocation() and set the location of the stack.

The reason for the math on the screen rect is because in a multi-monitor setup, the screenRects left for monitors to the right of another do NOT have 0,0 as the leftTop, but rather the left of the RIGHT monitor is the right of the LEFT monitor. I suppose it made sense to the developer at the time.

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

When me is not me

Bob Sneidar via use-livecode
I learned something today.

I was trying by script to set the hilite of a radio button in a group on another card.

My script is in the group “Language Choice” which is called by openStack. I’m thinking that “me” would operate on the group:

        set the hilitedButton of me to tNum

Didn’t work, even though the script received the message and completed. The radio buttons were unchanged. I modified it to this, which worked:

        set the hilitedButton of group "Language Choice" of card "Settings" to tNum


I can only think that, a group, even though it is on a single card and does not have its backgroundBehavior set to true, must be referred to explicitly by the name of the group and the name of the card is resides in. Or maybe it’s because the individual buttons didn't have sharedHilite set to true.

Peter Bogdanoff
ArtsInteractive


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
What version?  Its working for me in 9 dp11 by using either dispatch or
send to the group.

In the group:
command doit pbtn
   set the hilitedbutton of me to pbtn
end doit

And from the message box..

send ("doit" && 2) to group 1
or
dispatch "doit" to group 1 with 3


On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
[hidden email]> wrote:

> I learned something today.
>
> I was trying by script to set the hilite of a radio button in a group on
> another card.
>
> My script is in the group “Language Choice” which is called by openStack.
> I’m thinking that “me” would operate on the group:
>
>         set the hilitedButton of me to tNum
>
> Didn’t work, even though the script received the message and completed.
> The radio buttons were unchanged. I modified it to this, which worked:
>
>         set the hilitedButton of group "Language Choice" of card
> "Settings" to tNum
>
>
> I can only think that, a group, even though it is on a single card and
> does not have its backgroundBehavior set to true, must be referred to
> explicitly by the name of the group and the name of the card is resides in.
> Or maybe it’s because the individual buttons didn't have sharedHilite set
> to true.
>
> Peter Bogdanoff
> ArtsInteractive
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
Nevermind. Another card. DOH

On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]> wrote:

> What version?  Its working for me in 9 dp11 by using either dispatch or
> send to the group.
>
> In the group:
> command doit pbtn
>    set the hilitedbutton of me to pbtn
> end doit
>
> And from the message box..
>
> send ("doit" && 2) to group 1
> or
> dispatch "doit" to group 1 with 3
>
>
> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
> [hidden email]> wrote:
>
>> I learned something today.
>>
>> I was trying by script to set the hilite of a radio button in a group on
>> another card.
>>
>> My script is in the group “Language Choice” which is called by openStack.
>> I’m thinking that “me” would operate on the group:
>>
>>         set the hilitedButton of me to tNum
>>
>> Didn’t work, even though the script received the message and completed.
>> The radio buttons were unchanged. I modified it to this, which worked:
>>
>>         set the hilitedButton of group "Language Choice" of card
>> "Settings" to tNum
>>
>>
>> I can only think that, a group, even though it is on a single card and
>> does not have its backgroundBehavior set to true, must be referred to
>> explicitly by the name of the group and the name of the card is resides in.
>> Or maybe it’s because the individual buttons didn't have sharedHilite set
>> to true.
>>
>> Peter Bogdanoff
>> ArtsInteractive
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
Yes, it works great if you are on the card, not if you are somewhere else.


> On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <[hidden email]> wrote:
>
> Nevermind. Another card. DOH
>
> On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]> wrote:
>
>> What version?  Its working for me in 9 dp11 by using either dispatch or
>> send to the group.
>>
>> In the group:
>> command doit pbtn
>>   set the hilitedbutton of me to pbtn
>> end doit
>>
>> And from the message box..
>>
>> send ("doit" && 2) to group 1
>> or
>> dispatch "doit" to group 1 with 3
>>
>>
>> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
>> [hidden email]> wrote:
>>
>>> I learned something today.
>>>
>>> I was trying by script to set the hilite of a radio button in a group on
>>> another card.
>>>
>>> My script is in the group “Language Choice” which is called by openStack.
>>> I’m thinking that “me” would operate on the group:
>>>
>>>        set the hilitedButton of me to tNum
>>>
>>> Didn’t work, even though the script received the message and completed.
>>> The radio buttons were unchanged. I modified it to this, which worked:
>>>
>>>        set the hilitedButton of group "Language Choice" of card
>>> "Settings" to tNum
>>>
>>>
>>> I can only think that, a group, even though it is on a single card and
>>> does not have its backgroundBehavior set to true, must be referred to
>>> explicitly by the name of the group and the name of the card is resides in.
>>> Or maybe it’s because the individual buttons didn't have sharedHilite set
>>> to true.
>>>
>>> Peter Bogdanoff
>>> ArtsInteractive
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
I think I know what is going on.  If you add a couple of put statements to
that script you will find that "me" by itself doesn't include the card or
stack.  So "put me" would give something like [group "Language Choice"]
which isn't specific enough from another card.  This works:

local tID
put the long id of me into tID
set the hilitedButton of tID to tNum

But it can be simpler:

set the hilitedButton of the long id of me to tNum

I didn't do it from an openStack script, but from the message box while on
another card.

Thanks,
Brian

On Fri, Mar 9, 2018 at 8:10 PM Peter Bogdanoff via use-livecode <
[hidden email]> wrote:

> Yes, it works great if you are on the card, not if you are somewhere else.
>
>
> > On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <
> [hidden email]> wrote:
> >
> > Nevermind. Another card. DOH
> >
> > On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]> wrote:
> >
> >> What version?  Its working for me in 9 dp11 by using either dispatch or
> >> send to the group.
> >>
> >> In the group:
> >> command doit pbtn
> >>   set the hilitedbutton of me to pbtn
> >> end doit
> >>
> >> And from the message box..
> >>
> >> send ("doit" && 2) to group 1
> >> or
> >> dispatch "doit" to group 1 with 3
> >>
> >>
> >> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
> >> [hidden email]> wrote:
> >>
> >>> I learned something today.
> >>>
> >>> I was trying by script to set the hilite of a radio button in a group
> on
> >>> another card.
> >>>
> >>> My script is in the group “Language Choice” which is called by
> openStack.
> >>> I’m thinking that “me” would operate on the group:
> >>>
> >>>        set the hilitedButton of me to tNum
> >>>
> >>> Didn’t work, even though the script received the message and completed.
> >>> The radio buttons were unchanged. I modified it to this, which worked:
> >>>
> >>>        set the hilitedButton of group "Language Choice" of card
> >>> "Settings" to tNum
> >>>
> >>>
> >>> I can only think that, a group, even though it is on a single card and
> >>> does not have its backgroundBehavior set to true, must be referred to
> >>> explicitly by the name of the group and the name of the card is
> resides in.
> >>> Or maybe it’s because the individual buttons didn't have sharedHilite
> set
> >>> to true.
> >>>
> >>> Peter Bogdanoff
> >>> ArtsInteractive
> >>>
> >>>
> >>> _______________________________________________
> >>> use-livecode mailing list
> >>> [hidden email]
> >>> Please visit this url to subscribe, unsubscribe and manage your
> >>> subscription preferences:
> >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> >>
> >>
> >>
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
In theory that shouldn't be the problem - `the <property> of me` should
short-circuit to directly evaluating the property of the object with the
behavior, rather than evaluating `me` as a name first. This is why `put the
long id of me into tID` also works.

Peter, in your original script are you doing
 set the hilitedButton of me to tNum
directly, or
local tMe
put me into tMe
set the hilitedButton of tMe to tNum
?

The latter will have the 'not on the current card' problem, whereas the
former should (in theory) not.

On Sat, Mar 10, 2018 at 2:41 AM Brian Milby via use-livecode <
[hidden email]> wrote:

> I think I know what is going on.  If you add a couple of put statements to
> that script you will find that "me" by itself doesn't include the card or
> stack.  So "put me" would give something like [group "Language Choice"]
> which isn't specific enough from another card.  This works:
>
> local tID
> put the long id of me into tID
> set the hilitedButton of tID to tNum
>
> But it can be simpler:
>
> set the hilitedButton of the long id of me to tNum
>
> I didn't do it from an openStack script, but from the message box while on
> another card.
>
> Thanks,
> Brian
>
> On Fri, Mar 9, 2018 at 8:10 PM Peter Bogdanoff via use-livecode <
> [hidden email]> wrote:
>
> > Yes, it works great if you are on the card, not if you are somewhere
> else.
> >
> >
> > > On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <
> > [hidden email]> wrote:
> > >
> > > Nevermind. Another card. DOH
> > >
> > > On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]>
> wrote:
> > >
> > >> What version?  Its working for me in 9 dp11 by using either dispatch
> or
> > >> send to the group.
> > >>
> > >> In the group:
> > >> command doit pbtn
> > >>   set the hilitedbutton of me to pbtn
> > >> end doit
> > >>
> > >> And from the message box..
> > >>
> > >> send ("doit" && 2) to group 1
> > >> or
> > >> dispatch "doit" to group 1 with 3
> > >>
> > >>
> > >> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
> > >> [hidden email]> wrote:
> > >>
> > >>> I learned something today.
> > >>>
> > >>> I was trying by script to set the hilite of a radio button in a group
> > on
> > >>> another card.
> > >>>
> > >>> My script is in the group “Language Choice” which is called by
> > openStack.
> > >>> I’m thinking that “me” would operate on the group:
> > >>>
> > >>>        set the hilitedButton of me to tNum
> > >>>
> > >>> Didn’t work, even though the script received the message and
> completed.
> > >>> The radio buttons were unchanged. I modified it to this, which
> worked:
> > >>>
> > >>>        set the hilitedButton of group "Language Choice" of card
> > >>> "Settings" to tNum
> > >>>
> > >>>
> > >>> I can only think that, a group, even though it is on a single card
> and
> > >>> does not have its backgroundBehavior set to true, must be referred to
> > >>> explicitly by the name of the group and the name of the card is
> > resides in.
> > >>> Or maybe it’s because the individual buttons didn't have sharedHilite
> > set
> > >>> to true.
> > >>>
> > >>> Peter Bogdanoff
> > >>> ArtsInteractive
> > >>>
> > >>>
> > >>> _______________________________________________
> > >>> use-livecode mailing list
> > >>> [hidden email]
> > >>> Please visit this url to subscribe, unsubscribe and manage your
> > >>> subscription preferences:
> > >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> > >>
> > >>
> > >>
> > > _______________________________________________
> > > use-livecode mailing list
> > > [hidden email]
> > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
Ali, he was doing the former. So could this actually be a bug?
On Sat, Mar 10, 2018 at 6:17 AM Ali Lloyd via use-livecode <
[hidden email]> wrote:

> In theory that shouldn't be the problem - `the <property> of me` should
> short-circuit to directly evaluating the property of the object with the
> behavior, rather than evaluating `me` as a name first. This is why `put the
> long id of me into tID` also works.
>
> Peter, in your original script are you doing
>  set the hilitedButton of me to tNum
> directly, or
> local tMe
> put me into tMe
> set the hilitedButton of tMe to tNum
> ?
>
> The latter will have the 'not on the current card' problem, whereas the
> former should (in theory) not.
>
> On Sat, Mar 10, 2018 at 2:41 AM Brian Milby via use-livecode <
> [hidden email]> wrote:
>
> > I think I know what is going on.  If you add a couple of put statements
> to
> > that script you will find that "me" by itself doesn't include the card or
> > stack.  So "put me" would give something like [group "Language Choice"]
> > which isn't specific enough from another card.  This works:
> >
> > local tID
> > put the long id of me into tID
> > set the hilitedButton of tID to tNum
> >
> > But it can be simpler:
> >
> > set the hilitedButton of the long id of me to tNum
> >
> > I didn't do it from an openStack script, but from the message box while
> on
> > another card.
> >
> > Thanks,
> > Brian
> >
> > On Fri, Mar 9, 2018 at 8:10 PM Peter Bogdanoff via use-livecode <
> > [hidden email]> wrote:
> >
> > > Yes, it works great if you are on the card, not if you are somewhere
> > else.
> > >
> > >
> > > > On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <
> > > [hidden email]> wrote:
> > > >
> > > > Nevermind. Another card. DOH
> > > >
> > > > On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]>
> > wrote:
> > > >
> > > >> What version?  Its working for me in 9 dp11 by using either dispatch
> > or
> > > >> send to the group.
> > > >>
> > > >> In the group:
> > > >> command doit pbtn
> > > >>   set the hilitedbutton of me to pbtn
> > > >> end doit
> > > >>
> > > >> And from the message box..
> > > >>
> > > >> send ("doit" && 2) to group 1
> > > >> or
> > > >> dispatch "doit" to group 1 with 3
> > > >>
> > > >>
> > > >> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
> > > >> [hidden email]> wrote:
> > > >>
> > > >>> I learned something today.
> > > >>>
> > > >>> I was trying by script to set the hilite of a radio button in a
> group
> > > on
> > > >>> another card.
> > > >>>
> > > >>> My script is in the group “Language Choice” which is called by
> > > openStack.
> > > >>> I’m thinking that “me” would operate on the group:
> > > >>>
> > > >>>        set the hilitedButton of me to tNum
> > > >>>
> > > >>> Didn’t work, even though the script received the message and
> > completed.
> > > >>> The radio buttons were unchanged. I modified it to this, which
> > worked:
> > > >>>
> > > >>>        set the hilitedButton of group "Language Choice" of card
> > > >>> "Settings" to tNum
> > > >>>
> > > >>>
> > > >>> I can only think that, a group, even though it is on a single card
> > and
> > > >>> does not have its backgroundBehavior set to true, must be referred
> to
> > > >>> explicitly by the name of the group and the name of the card is
> > > resides in.
> > > >>> Or maybe it’s because the individual buttons didn't have
> sharedHilite
> > > set
> > > >>> to true.
> > > >>>
> > > >>> Peter Bogdanoff
> > > >>> ArtsInteractive
> > > >>>
> > > >>>
> > > >>> _______________________________________________
> > > >>> use-livecode mailing list
> > > >>> [hidden email]
> > > >>> Please visit this url to subscribe, unsubscribe and manage your
> > > >>> subscription preferences:
> > > >>> http://lists.runrev.com/mailman/listinfo/use-livecode
> > > >>
> > > >>
> > > >>
> > > > _______________________________________________
> > > > use-livecode mailing list
> > > > [hidden email]
> > > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > [hidden email]
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
It certainly sounds like it to me...

On Sat, 10 Mar 2018 at 17:05, Brian Milby <[hidden email]> wrote:

> Ali, he was doing the former. So could this actually be a bug?
> On Sat, Mar 10, 2018 at 6:17 AM Ali Lloyd via use-livecode <
> [hidden email]> wrote:
>
>> In theory that shouldn't be the problem - `the <property> of me` should
>> short-circuit to directly evaluating the property of the object with the
>> behavior, rather than evaluating `me` as a name first. This is why `put
>> the
>> long id of me into tID` also works.
>>
>> Peter, in your original script are you doing
>>  set the hilitedButton of me to tNum
>> directly, or
>> local tMe
>> put me into tMe
>> set the hilitedButton of tMe to tNum
>> ?
>>
>> The latter will have the 'not on the current card' problem, whereas the
>> former should (in theory) not.
>>
>> On Sat, Mar 10, 2018 at 2:41 AM Brian Milby via use-livecode <
>> [hidden email]> wrote:
>>
>> > I think I know what is going on.  If you add a couple of put statements
>> to
>> > that script you will find that "me" by itself doesn't include the card
>> or
>> > stack.  So "put me" would give something like [group "Language Choice"]
>> > which isn't specific enough from another card.  This works:
>> >
>> > local tID
>> > put the long id of me into tID
>> > set the hilitedButton of tID to tNum
>> >
>> > But it can be simpler:
>> >
>> > set the hilitedButton of the long id of me to tNum
>> >
>> > I didn't do it from an openStack script, but from the message box while
>> on
>> > another card.
>> >
>> > Thanks,
>> > Brian
>> >
>> > On Fri, Mar 9, 2018 at 8:10 PM Peter Bogdanoff via use-livecode <
>> > [hidden email]> wrote:
>> >
>> > > Yes, it works great if you are on the card, not if you are somewhere
>> > else.
>> > >
>> > >
>> > > > On Mar 9, 2018, at 6:03 PM, Mike Bonner via use-livecode <
>> > > [hidden email]> wrote:
>> > > >
>> > > > Nevermind. Another card. DOH
>> > > >
>> > > > On Fri, Mar 9, 2018 at 6:59 PM, Mike Bonner <[hidden email]>
>> > wrote:
>> > > >
>> > > >> What version?  Its working for me in 9 dp11 by using either
>> dispatch
>> > or
>> > > >> send to the group.
>> > > >>
>> > > >> In the group:
>> > > >> command doit pbtn
>> > > >>   set the hilitedbutton of me to pbtn
>> > > >> end doit
>> > > >>
>> > > >> And from the message box..
>> > > >>
>> > > >> send ("doit" && 2) to group 1
>> > > >> or
>> > > >> dispatch "doit" to group 1 with 3
>> > > >>
>> > > >>
>> > > >> On Fri, Mar 9, 2018 at 6:23 PM, Peter Bogdanoff via use-livecode <
>> > > >> [hidden email]> wrote:
>> > > >>
>> > > >>> I learned something today.
>> > > >>>
>> > > >>> I was trying by script to set the hilite of a radio button in a
>> group
>> > > on
>> > > >>> another card.
>> > > >>>
>> > > >>> My script is in the group “Language Choice” which is called by
>> > > openStack.
>> > > >>> I’m thinking that “me” would operate on the group:
>> > > >>>
>> > > >>>        set the hilitedButton of me to tNum
>> > > >>>
>> > > >>> Didn’t work, even though the script received the message and
>> > completed.
>> > > >>> The radio buttons were unchanged. I modified it to this, which
>> > worked:
>> > > >>>
>> > > >>>        set the hilitedButton of group "Language Choice" of card
>> > > >>> "Settings" to tNum
>> > > >>>
>> > > >>>
>> > > >>> I can only think that, a group, even though it is on a single card
>> > and
>> > > >>> does not have its backgroundBehavior set to true, must be
>> referred to
>> > > >>> explicitly by the name of the group and the name of the card is
>> > > resides in.
>> > > >>> Or maybe it’s because the individual buttons didn't have
>> sharedHilite
>> > > set
>> > > >>> to true.
>> > > >>>
>> > > >>> Peter Bogdanoff
>> > > >>> ArtsInteractive
>> > > >>>
>> > > >>>
>> > > >>> _______________________________________________
>> > > >>> use-livecode mailing list
>> > > >>> [hidden email]
>> > > >>> Please visit this url to subscribe, unsubscribe and manage your
>> > > >>> subscription preferences:
>> > > >>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> > > >>
>> > > >>
>> > > >>
>> > > > _______________________________________________
>> > > > use-livecode mailing list
>> > > > [hidden email]
>> > > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription preferences:
>> > > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > >
>> > >
>> > > _______________________________________________
>> > > use-livecode mailing list
>> > > [hidden email]
>> > > Please visit this url to subscribe, unsubscribe and manage your
>> > > subscription preferences:
>> > > http://lists.runrev.com/mailman/listinfo/use-livecode
>> > _______________________________________________
>> > use-livecode mailing list
>> > [hidden email]
>> > Please visit this url to subscribe, unsubscribe and manage your
>> > subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: When me is not me

Bob Sneidar via use-livecode
It is this sort of thing which inspired me to start using long id's for everything whenever I make calls to cards or stacks not the one I am currently on. That is why I created getParentCard() and getParentStack(). I then pass the local long id of the callign object to whatever script I am callign in another place.

I have posted these in the past, let me know if you need them. All I do is pass the long ID of the object that is calling these functions, and all they do is parse the long id string by eliminating everything before the first occurrance of the word "card" or "stack" respectively.

Bob S
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode