[UP] use ion3-plus haha.
[arrow.git] / archlinux_conf / etc / ion3 / old / notifybox.lua
blobbff05685513ce965a6cf59df9b1f8402f94d1319
2 notifybox={}
4 local default="*notifybox*"
6 local function get_box(name)
7 return ioncore.lookup_region(name, "WInfoWin")
8 end
10 function notifybox.show(message, name, location, style, scr)
11 if not name then
12 name=default
13 end
15 if not scr then
16 scr=ioncore.find_screen_id(0)
17 end
19 local box=get_box(name)
21 if not box then
22 box=scr:attach_new{
23 type="WInfoWin",
24 name=name,
25 sizepolicy=location or "southeast",
26 unnumbered=true,
27 level=10,
28 passive=true,
29 style=style,
30 geom={w=1, h=1, x=0, y=0},
32 end
34 -- Hack: attach_new doesn't get geometries right if we pass msg
35 -- directly to it.
36 box:set_text(message, scr:geom().w)
37 end
40 function notifybox.hide(name)
41 local box=get_box(name or default)
43 if box then
44 box:rqclose()
45 end
46 end