Notifications
Clear all

[Closed] Remove Rollout From current Window

Hi all,

I seem to be stuck here on some ui Creation.

I have a base rollout that has several subrollouts inside of it.

I am using buttons to add other defined rollouts in to the subrollouts of the main window, They load up fine but i am stuck in trying to remove them from the window once i am done with them…

I have tried both the removeRollout and the removeSubRollout command…

all of which just return OK

is there another command that i am missing somewhere?

Thanks

3 Replies

should be rather simple…


global test_floater

rollout test_roll_1 "test rollout 1" (
	label lbl_test "test rollout 1"
)
rollout test_roll_2 "test rollout 2" (
	label lbl_test "test rollout 2"
)
rollout test_subroll_1 "test subrollout 1" (
	label lbl_test "test subrollout 1"
)
rollout test_subroll_2 "test subrollout 2" (
	label lbl_test "test subrollout 2"
)

rollout test_control "test control" (
	checkbutton ckb_roll_1 "rollout 1"
	checkbutton ckb_roll_2 "rollout 2"
	checkbutton ckb_subroll_1 "subrollout 1"
	checkbutton ckb_subroll_2 "subrollout 2"
	subrollout sub_roll "subrollout here" width:256 height:64 align:#center
	
	on ckb_roll_1 changed state do (
		if (state) then ( addrollout test_roll_1 test_floater )
		else ( removerollout test_roll_1 test_floater )
	)
	on ckb_roll_2 changed state do (
		if (state) then ( addrollout test_roll_2 test_floater )
		else ( removerollout test_roll_2 test_floater )
	)
	on ckb_subroll_1 changed state do (
		if (state) then ( addsubrollout sub_roll test_subroll_1 )
		else (removesubrollout sub_roll test_subroll_1 )
	)
	on ckb_subroll_2 changed state do (
		if (state) then ( addsubrollout sub_roll test_subroll_2 )
		else ( removesubrollout sub_roll test_subroll_2 )
	)
)

test_floater = newRolloutFloater "Hello" 512 512
addrollout test_control test_floater

Not that a subrollout UI item will remain visible even if there’s no rollouts inside it – you can play with its .height value to make it conform to the rollouts inside and set it to zero (or set its .visible to false) to actually hide it.

Awesome thanks for the help, i will try that next time…

what i wound up doing was changing the text label and button commands depending on which error i was getting, i will definetly keep this in mind for next time.

The reason i switched was because i would have to have a different rollout for every error… which could get pretty heavy, this way i have one rollout and different error states.

Thanks for the help,

Adam

yikes – yes, if you’re just dealing with error messages, go with a label… or an edittext control… or format to the listener / a messagebox / a new script window if it’s a long error