BYOND provides a winclone() function which is very useful for creating more child windows / panes dynamically as needed. A windel() function is equally desirable in unique situations where there are technically an unlimited number of child windows to be used but the windows should be temporary.
As an example:
Suppose I am creating a chat program which provides PM and channel or (room) based windows. Such windows need to be unique per-player. But what happens when a player visits 500+ rooms? Eventually all those winclone() calls begin cluttering up the the temp rsc of the player. To be able to destroy this no longer needed temp rsc is very convenient and friendly.
If there is already a way to accomplish this could someone kindly let me know? The only way I know of to get rid of the rsc to start over is to disconnect and reconnect to the game.
ID:104194
Nov 4 2010, 8:07 pm
|
|||||||
Resolved
| |||||||
Nov 5 2010, 12:26 am
|
|
+1 Vote.
|
DivineTraveller wrote:
Set the parent to null, is the closest thing I can think of. Ah thanks man, I know that you can set parent to null, but I am not sure if/how that works with windows/panes. Optionally if I had some statically dynamic (likely badly worded) preset of like say, 5 panes/windows then yes the parent = null trick would keep things cleaner than using winclone. If you figure out a way to eliminate the actual cloned win/pane from the rsc that'd be awesome. Thanks again for the mention of setting parent = null. That had slipped my mind but for what I am working on, a static set that is handled dynamically at runtime would work. |
I support this.
If the window is no longer needed, I should be able to remove it from the .rsc. |
One possible problem I could foresee with this kind of request would be using windel() to delete default skin elements such as the main window/pane.
If at all possible, is this being considered at all? It seems to have alot of positive comments. With such a feature I have a nice surprise in something I have been developing. |
Ghtry wrote:
One possible problem I could foresee with this kind of request would be using windel() to delete default skin elements such as the main window/pane. There could be some restrictions to using "windel()" in such a case that the user cannot delete compile-time windows or controls. This can urge developers to use the window panes solely as templates. |
Ghtry wrote:
One possible problem I could foresee with this kind of request would be using windel() to delete default skin elements such as the main window/pane. People who use it should be smart enough not to delete the main window. In any case, that would just disconnect them from the game in the same way client.Del() does, I suppose. |
Warlord Fred wrote:
People who use it should be smart enough not to delete the main window. In any case, that would just disconnect them from the game in the same way client.Del() does, I suppose. No, it would just not let you delete anything that's part of the standard interface. You're not allowed to remove preset things, but anything generated at runtime is able to be removed (although, not from the RSC, from what is going on here). |