ID:1425297
 
(See the best response by Kaiochao.)
Problem description:

Title says it all mostly, but is it possible to create a window / windowskin component on the fly? Without putting them in the windowskin (where someone could potentially be altered.)

IE:
1) A temporary window with a progress bar and a label, the progress bar accessible by using winset() proc so it can be updated as a separate procedure progresses, and then closed when the progress has been completed.

2) A temporary window with a browser inside it that opens up with specific information, closable when the player reads the information and not accessible again.
Best response
Have you checked the Skin Reference? It has a section on creating interface elements in code.
I voted Kaiacho, if you go into the Skin References it's all there (dream maker->help->skin references). Or you could set client/control_freak to disable skin alterations.
This works for controls it says, but is it possible to create a completely new window using this?

mob/verb/Test2()
var/list/params = new
params["parent"] = "mainwindow"
params["type"] = "window"
params["title"] = "New Window"
params["pos"] = "10,10"
params["size"] = "200x100"
params["is-visible"] = "true"
winset(usr, "newwindow", list2params(params))


Tried this, but it doesn't seem to do anything
If you want to create a window just make a blank window in your interface file and use winclone() to clone that into a new window and build your controls from there.
I must admit, you had me curious because I had never tried to do this. So I ran some tests and did some reading. It turns out winclone() can be used to create a "blank" window with no reference to it.

    winclone(src,"window","newwindow")
var/list/params = new
params["pos"] = "10,10"
params["size"] = "200x100"
params["is-visible"] = "true"
winset(usr, "newwindow", list2params(params))


If you copy and paste that into your game, it should create a new window for you.

*Edit*

To clarify, I ran that script to create a new blank window, and I did "not" have a parent window named "window" already. All I had was one named "default". Like I said, it was interesting XD.
I totally forgot about winclone() doing that, good catch. Keep in mind that it only works with "window", "pane", "menu", and "macro", not other values, otherwise you'll get an 'element not found' error. Tis in the reference.
In response to Ss4toby
Right, that's in the DM Reference for winclone().
Thanks, the winclone proc worked, and the skin reference section helped create controls on said window.

End Result:

mob/verb/Test2()
winclone(src,"window","progresswindow")
var/list/params = new
params["pos"] = "30,30"
params["size"] = "400x100"
params["is-visible"] = "true"
winset(usr, "progresswindow", list2params(params))
params = new
params["parent"] = "progresswindow"
params["type"] = "button"
params["text"] = "New button"
params["command"] = "say \"This is a new button.\""
params["pos"] = "10,10"
params["size"] = "80x20"
params["anchor1"] = "0,0"
winset(usr, "newbutton", list2params(params))

sleep(50)
winset(usr, "progresswindow", "parent=''")


Creates a window and a button for 5 seconds then closes it. Don't know if it properly 'disposes' of it though, would this be correct?
I'm not sure if it matters, but the dm reference example for closing is to set parent to none.

winset(usr, "newwindow", "parent=none")
In response to Ss4toby
That works too.

Thanks to everyone for the help. :)

Someone close this topic?