setting rects of players in repeat loop works in IDE but not in standalone

Klaus Major klaus at major-k.de
Thu Jan 8 05:59:28 EST 2009


Hi friends,

I have a very strange problem, as always :-)

We are developing a "webcam viewer app" that works quite fine with the  
QT "rtsp" protocol.
The user can open several windows for the different camera.
There is a button that lets the user change the window/player size.
All this works fine so far.

The we decided to save these open windows on quit and restore them  
when the app starts again.
Again this does work fine so far except one very important thing:
The rects of the players do not get set correctly!

I saved a complete stack in a custom property as a "template", so I do  
not need to bother with cloning
and managing existing stacks :-)


Here is the relevant part of the repeat loop:

...
  repeat for each line k in tSettings2
     ## TAB delimited list of all previously opened stacks
     ## 1. Stackname
     ## 2. Rect of Stack
     ## 3. Rect of Player
     ## 4. Filename of Player
     put item 1 of k into stack_name
     put item 2 of k into stack_rect
     put item 3 of k into player_rect
     put item 4 of k into player_filename

     ## Get and go to Stack in CP...
     ## Works:
     get the spycam_sub of stack "iDualCamViewer"
     go stack it

     ## Works:
     ## "spycam_sub" is the name of the stack that I imported into the  
CP
     set the name of stack "spycam_sub" to stack_name

     ## Works:
     set the title of stack stack_name to stack_name

     ## Works:
     set the rect of stack stack_name to stack_rect

     ## Does NOT work, looks like only the very first value is being  
used, but only for the players:
     set the rect of player "spycam" of cd 1 of stack stack_name to  
player_rect

     ## To check my sanity I added a graphic, which also works!!!
    set the rect of grc "dummy" to player_rect
     wait 100 millisecs
   end repeat
...

Again, this works fine in the IDE, but fails in a standalone.
In a standalone all players have the rect of the FIRST player_rect!
(item 4 of FIRST line of "tSettings2")

I tried a zillion things, like creating players on-the-fly:
set the rect of the templateplayer to player_rect
create player "spycam"
...

Or saving the loc/widh/height of the players and setting them..

No way, always same problem as above.

Since the "dummy" graphic gets set to the correct rect, the stored  
values are definitvely correct
and do change in the repeat loop.

Looks like there is some QT/player issue in standalones?

Any ideas, before I bug report this real "blocker"?


Best

Klaus Major
klaus at major-k.de
http://www.major-k.de





More information about the use-livecode mailing list