ID:110220
 
Resolved
Windows cloned with winclone() did not return the right ID in winget().
BYOND Version:480
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 4.0
Applies to:Dream Seeker
Status: Resolved (481)

This issue has been resolved.
Descriptive Problem Summary:
When you clone a window with winclone(), the 'id' parameter of the resulting window is the ID of the window that was cloned.

Numbered Steps to Reproduce Problem:
1.) Create a window with the name 'csel' for instance,
2.) Run the code below.

Code Snippet (if applicable) to Reproduce Problem:
client/New()
..()
winclone(src, "csel", "charsel")
winclone(src, "csel", "charsel2")
winclone(src, "csel", "charsel3")
world.log << "[winget(src, "charsel", "id")]"
world.log << "1 [winget(src, "charsel2", "id")]"
world.log << "2 [winget(src, "charsel3", "id")]"


Expected Results:
charsel
charsel2
charsel3

Actual Results:
csel
csel
csel

Does the problem occur:
Every time? Or how often? Every time
In other games? I'm sure.
In other user accounts? I'm sure.
On other computers? I'm sure.

When does the problem NOT occur? When it's not a cloned window.

Workarounds:
None

Additional Notes:
It's not really that big of a deal to me, but I was attempting to do something like the following:

        CharDelWindow()
if(winexists(src, "charsel"))
var/list/ctls = params2list(winget(src, "charsel.*", "id"))
for(var/i in ctls)
//if(ctls[i] == "csel") continue
winset(src, "charsel.[ctls[i]]","parent=null")

return 1


Where 'charsel' was cloned from 'csel', and I kept having a control with the ID 'csel' returned even though the resulting winset(parent=null) failed. I then discovered that all cloned windows use this, so I would have to either deal with the error or just keep track of which window spawned this one.