Notifications
Clear all

[Closed] Closing a rollout with OK or enter

Part of a script I’m writing throws a rollout dialogue to allow the user to rename a newly imported object. Pressing OK will rename the object.
Note: I’m not even sure if a rollout is a good choice for such a prompt.
I’m trying to make the rollout close on either OK pressed or Enter (currently only closes on window close).
You can see the various avenues I’ve attempted by the commented out section.


rollout Name_Import “Imported object renamer” width:300
(
label label1 “Enter name”
edittext nameField “”
button renameImport “OK”

        on renameHP pressed do
        (
            if nameField.text == "" then
            (
                messagebox "Please enter a valid name"
            )
            else
            (
                $.name = nameField.text
            )
        -- removeRollout Name_HP
         -- closeRollout Name_HP
         --closeRolloutFloater myFloater
        )
    )

I’ve tried encapsulating this within a rolloutfloater by
–myFloater = newrolloutfloater “Rename Hard Point” 300 120
–addrollout Name_HP myFloater
then destroying the rolloutfloater with the above commented out closeRolloutFloater which did not work.

Thoughts?
Thanks, in advance.

2 Replies
 eek

destroyDialog theRolloutName

Most awesome.
Thanks.