init
This commit is contained in:
commit
d2743fe41d
22 changed files with 2290 additions and 0 deletions
25
scripts/test-x.lua
Executable file
25
scripts/test-x.lua
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/env luajit
|
||||
package.cpath = package.cpath .. ";lib/?.so"
|
||||
local X = require("x")
|
||||
|
||||
local root = assert(X.open())
|
||||
local win = X.createWindow()
|
||||
|
||||
X.setErrorHandler(print)
|
||||
|
||||
atom, integer = X.getAtoms("ATOM", "INTEGER")
|
||||
assert(atom == 4 and integer == 19)
|
||||
assert(X.getAtomNames(atom) == "ATOM")
|
||||
|
||||
X.setProperty(win, X.getAtoms("test"), atom, 32, X.PropModeReplace, 69)
|
||||
assert(X.getProperty(win, X.getAtoms("test"), 0, atom) == 69)
|
||||
|
||||
X.setProperty(win, X.getAtoms("test"), X.getAtoms("STRING"), 8, X.PropModeReplace, "hello")
|
||||
assert(X.getProperty(win, X.getAtoms("test"), 0, X.getAtoms("STRING")) == "hello")
|
||||
|
||||
X.delProperty(win, X.getAtoms("test"))
|
||||
assert(not X.delProperty(win, X.getAtoms("test"), 0, X.getAtoms("STRING")))
|
||||
|
||||
assert(X.getMonitors() and X.getWindowAttributes(win))
|
||||
|
||||
X.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue