Script Error "to" on attempt to change rect/location of a group of 5 controls

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

Script Error "to" on attempt to change rect/location of a group of 5 controls

Sannyasin Brahmanathaswami
I have a small group meant for a bottom tool bar on Mobile. I need to be able to "dock" to the bottom if we are in portrait orientation or to the left side if we are in landscape.

The group consists of a background graphic 50 px high and 414 wide.. with four SVG icon widgets

This codes seems straight forward

on setBottomNavtoSideAndBack pWhich
switch pWhich
case "Bottom"
set the rect of grc "bottomTabBkgnd" to 161,365,575,415
set the rect of grp "homeScreensBottomNav" to 161,365,575,415
set the loc of widget "go-home-portal" to 218,390
put the loc of widget "queue-content" to 315,390
put the loc of widget "add-favorites" to 404,390
put the loc of widget "settings-gear" to 498,390
break
case "Side"
set the rect of grc "bottomTabBkgnd" to 0,50,50,464
set the rect of grp "homeScreensBottomNav" to 0,50,50,464
set the loc of widget "go-home-portal" to 65,24
put the loc of widget "queue-content" to 100,24
put the loc of widget "add-favorites" to 150,24
put the loc of widget "settings-gear" to 175,24
break
end switch
show grp "homeScreensBottomNav"
end setBottomNavtoSideAndBack
This fails and also throws an error that doesn't help understand what is wrong:

Message execution error:
Error description: Handler: can't find handler
Hint: to

My gut is telling me that there is some esoteric issue with this being a group and then trying to change both it's rect and the rect of its child elements.

Any clues?

BR

_______________________________________________
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: Script Error "to" on attempt to change rect/location of a group of 5 controls

Dave Kilroy
Hi, instead of

put the loc of widget "queue-content" to 315,390

try

set the loc of widget "queue-content" to 315,390
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
Reply | Threaded
Open this post in threaded view
|

Re: Script Error "to" on attempt to change rect/location of a group of 5 controls

Sannyasin Brahmanathaswami
Set. Not

Put

Right

Oh duh! I think I need to get away from the code for a few days and go mill firewood for our camp out!

Br

( from my mobile )

_____________________________
From: Dave Kilroy <[hidden email]<mailto:[hidden email]>>

Hi, instead of

put the loc of widget "queue-content" to 315,390

try

set the loc of widget "queue-content" to 315,390



-----
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
--
View this message
_______________________________________________
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: Script Error "to" on attempt to change rect/location of a group of 5 controls

Sannyasin Brahmanathaswami
This works now I fixed my "blooper" (put instead of "set"… one caveat
 
When dynamically relocating the controls of the group. This process seems to relayer them.

So if you set the background as the last in the list… the other controls are underneath..

So, order matters here:

on setBottomNavtoSideAndBack pWhich
   switch pWhich
      case "Bottom"
          set the rect of grp "homeScreensBottomNav" to 161,365,575,415
          set the rect of grc "bottomTabBkgnd" to 161,365,575,415

# Be sure you set the above first… only then will these appear on top
         set the loc of widget "go-home-portal" to 218,390
         set the loc of widget "queue-content" to 315,390
         set the loc of widget "add-favorites" to 404,390
         set the loc of widget "settings-gear" to 498,390
       
         break
      case "Side"
           set the rect of grp "homeScreensBottomNav" to 0,0,50,464
         set the rect of grc "bottomTabBkgnd" to 0,0,50,464

# Be sure you set the above first… only then will these appear on top
         set the loc of widget "go-home-portal" to 25,65
         set the loc of widget "queue-content" to 25,115
         set the loc of widget "add-favorites" to 25,165
         set the loc of widget "settings-gear" to 25,215
         break
   end switch
     show grp  "homeScreensBottomNav"
   
end setBottomNavtoSideAndBack

On 5/14/16, 9:49 PM, "use-livecode on behalf of Sannyasin Brahmanathaswami" <[hidden email] on behalf of [hidden email]> wrote:

>Set. Not
>
>Put
>
>Right
>
>Oh duh! I think I need to get away from the code for a few days and go mill firewood for our camp out!
>
>Br

_______________________________________________
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