diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-25 13:41:32 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-18 21:04:24 (GMT) |
commit | 5f241445b54fab048fa0f58343bc944cd2818947 (patch) | |
tree | 8541f90384c51f6539a325bd41f67d6c590cfcde /src/FbTk | |
parent | 8e408fb12177586d09bc42536bbf54db54fa605d (diff) | |
download | fluxbox_pavel-5f241445b54fab048fa0f58343bc944cd2818947.zip fluxbox_pavel-5f241445b54fab048fa0f58343bc944cd2818947.tar.bz2 |
Add readOnlySetField to FbTk::Lua
an equivalent of rawsetfield, but for "read only" tables.
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/LuaUtil.cc | 9 | ||||
-rw-r--r-- | src/FbTk/LuaUtil.hh | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/FbTk/LuaUtil.cc b/src/FbTk/LuaUtil.cc index 8f382e8..a5413f2 100644 --- a/src/FbTk/LuaUtil.cc +++ b/src/FbTk/LuaUtil.cc | |||
@@ -132,4 +132,13 @@ void Lua::readOnlySet(int index) { | |||
132 | pop(); | 132 | pop(); |
133 | } | 133 | } |
134 | 134 | ||
135 | void Lua::readOnlySetField(int index, const char *k) { | ||
136 | checkstack(1); | ||
137 | index = absindex(index); | ||
138 | |||
139 | pushstring(k); | ||
140 | insert(-2); | ||
141 | readOnlySet(index); | ||
142 | } | ||
143 | |||
135 | } // namespace FbTk | 144 | } // namespace FbTk |
diff --git a/src/FbTk/LuaUtil.hh b/src/FbTk/LuaUtil.hh index 12a687e..2c611ac 100644 --- a/src/FbTk/LuaUtil.hh +++ b/src/FbTk/LuaUtil.hh | |||
@@ -52,6 +52,7 @@ public: | |||
52 | * It can be used to modify protected entries or create new ones. | 52 | * It can be used to modify protected entries or create new ones. |
53 | */ | 53 | */ |
54 | void readOnlySet(int index); | 54 | void readOnlySet(int index); |
55 | void readOnlySetField(int index, const char *k); | ||
55 | 56 | ||
56 | typedef Slot<void, Lua &> InitFunction; | 57 | typedef Slot<void, Lua &> InitFunction; |
57 | 58 | ||