ID:814466
 
(See the best response by DarkCampainger.)
Code:
proc/hairGrid()
var/list/hairs = list(new/obj/Hair/buzz_cut, new/obj/Hair/afro)
var/i = 0
for(var/obj/Hair/h in hairs)
i++
winset(src, "id", "current-cell=1,[i]")
src << output(h, "id")
winset(src, "id", "cells=[i]")


obj/Hair
Click()
usr << "You clicked it!"


Problem description:
The "You clicked it!" Message doesn't show up. What am I doing wrong?

P.S. The objs show just fine in the grid.
Best response
You're displaying temporary objects in the grid. So, although their visuals hang about for a bit, they've actually already been garbage collected and deleted by the time you go to click them. You need to give them some more permanent storage.

Also, you can combine the "current-cell" setting into the output() command:
src << output(h, "id:1,[i]")


And your cells setting should be two-dimensional:
winset(src, "id", "cells=1x[i]")


You can find some more interesting info on grids in the skin reference
Holy crap. Now I feel really stupid. That makes perfect sense. I just transferred the list to an external variable and it works like a charm. Thanks a ton!