Mr-BlueSummers
02-22-2008, 09:26 PM
Hey fellas,
Here's an interesting one. I'm creating a plug-in that needs to manage a few rollouts. Unfortunately, when you create a scripted plug and define rollouts, they're automatically added to the body of the UI and it seems there's no way to remove it without an explicit event. My goal is to define some rollouts without displaying them, and add/remove them as needed. Take a look:
plugin simpleMod Mod1
name:"Mod1"
ClassID:#(0x75e16d7e, 0x236a84d3)
category:"Scripted Primitives"
(
local R1, R2
rollout R1 "Rollout 1"
(
checkbox thisCheckbox "Show Alt Rollout"
-- When checked, make the second rollout available.
on thisCheckbox changed val do
if val then addRollout R2
else removeRollout R2
)
rollout R2 "Rollout 2"
(
button thisButton "Clicky!"
-- Display a message to show the button works.
on thisButton pressed do
messageBox "Works!"
)
--on //Startup?// do removeRollout R2
)
I tried reading through the manual, but on load, on postLoad, on Create, and on postCreate all fail to remove the 2nd rollout from the modifier window before the user sees it.
Any thoughts?
Here's an interesting one. I'm creating a plug-in that needs to manage a few rollouts. Unfortunately, when you create a scripted plug and define rollouts, they're automatically added to the body of the UI and it seems there's no way to remove it without an explicit event. My goal is to define some rollouts without displaying them, and add/remove them as needed. Take a look:
plugin simpleMod Mod1
name:"Mod1"
ClassID:#(0x75e16d7e, 0x236a84d3)
category:"Scripted Primitives"
(
local R1, R2
rollout R1 "Rollout 1"
(
checkbox thisCheckbox "Show Alt Rollout"
-- When checked, make the second rollout available.
on thisCheckbox changed val do
if val then addRollout R2
else removeRollout R2
)
rollout R2 "Rollout 2"
(
button thisButton "Clicky!"
-- Display a message to show the button works.
on thisButton pressed do
messageBox "Works!"
)
--on //Startup?// do removeRollout R2
)
I tried reading through the manual, but on load, on postLoad, on Create, and on postCreate all fail to remove the 2nd rollout from the modifier window before the user sees it.
Any thoughts?
