Jump to content
Developer Wiki and Function Reference Links ×

Delete PIO in a PIO Button-Code

Recommended Posts


I have a PIO with Button-Widgets. One of them should convert the PIO in another PIO and back. Is it possible to delete the PIO with the Button at all?

	elif theButton == cButton6:
		if replace_object():
			vs.AlertInform('Press delete after action to delete original object', '','') #This would work so far
			vs.DelObject(GlobalValues.pio_handle) #This wont work (and if it would work i think it may result in a crash?)


Edited by DomC
Link to comment

I think maybe you need to have the new PIO delete the old PIO. When you instantiate the new PIO, you can have the old PIO insert its own handle into a hidden parameter of the new PIO, then reset the new PIO. The new PIO could check this parameter every time it's reset and do nothing if blank but delete the handle when there is a handle in the parameter. Hopefully that makes sense?

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...