DomC Posted February 28, 2024 Share Posted February 28, 2024 (edited) Hello 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.DSelectAll() vs.SetSelect(GlobalValues.pio_handle) 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 February 28, 2024 by DomC Quote Link to comment
DomC Posted February 28, 2024 Author Share Posted February 28, 2024 vs.DoMenuTextByName('Clear',0) OK, this would delete the Original PIO. But i am not feeling good by using a DoMenuText in this situation. Quote Link to comment
DomC Posted February 28, 2024 Author Share Posted February 28, 2024 It seems to be possible also by deleting with the selection state. So far it seems to be the best option. vs.DeleteObjs() Quote Link to comment
Juliensv Posted March 4, 2024 Share Posted March 4, 2024 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? 1 Quote Link to comment
Recommended Posts
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.