Improved caption demo script a bit.
[screen-lua.git] / src / scripts / caption.lua
blobf25f8c878ad8786d555d59c64e1960eb1e9d1918
1 function captionprocess (canvas)
2 display = canvas.display
3 windows = screen.windows()
5 caption = " "
6 for i, w in ipairs(windows) do
7 t = string.format("%d: %s", w.number, w.title)
8 if w == canvas.window then
9 t = string.format("%%{= wb}%s%%{= wk}", t)
10 end
11 caption = caption .. t .. " "
12 end
14 canvas.caption = caption
15 return 1
16 end
18 screen.hook("processcaption", captionprocess);