Message 1 of 1
Scripted attributes and Rollout Creator

Not applicable
01-17-2011
03:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I'm using rolloutCreator to generate a dynamic rollout, update it when you click on a button, etc.
Everything works fine when I use that rollout in a rolloutFloater, I juste need to set up a few variables in global scope.
Then I can just delete and add again the rollout once it's updated by the rolloutCreator.
The problem comes when I try to do the same in a Scripted Attribute, as the rollouts are defined directly in the attribute and the functions addRollout and removeRollout can only act on the local rollouts.
I'll put a little dumb example of how it works in a rolloutFloater :
So this works fine but I don't manage to get the same thing in a scripted attribute...
Anyone has an idea ?
I'm using rolloutCreator to generate a dynamic rollout, update it when you click on a button, etc.
Everything works fine when I use that rollout in a rolloutFloater, I juste need to set up a few variables in global scope.
Then I can just delete and add again the rollout once it's updated by the rolloutCreator.
The problem comes when I try to do the same in a Scripted Attribute, as the rollouts are defined directly in the attribute and the functions addRollout and removeRollout can only act on the local rollouts.
I'll put a little dumb example of how it works in a rolloutFloater :
global countBtn = 1
(
fn refreshRoll n =
(
r = rolloutCreator "interactiveRF" "interactiveRF"
r.begin()
for i = 1 to n do
(
r.addControl #button (("btn"+(i as string)) as name) ("Button "+(i as string))
)
r.end()
)
rollout staticRF "Static"
(
button btnAdd "Add Button!"
on btnAdd pressed do
(
countBtn += 1
removeRollout interactiveRF rf
refreshRoll countBtn
addRollout interactiveRF rf
)
)
refreshRoll countBtn
rf = newRolloutFloater "RF" 200 200
addRollout staticRF rf
addRollout interactiveRF rf
)
So this works fine but I don't manage to get the same thing in a scripted attribute...
Anyone has an idea ?