diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-25 13:41:32 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-07-25 13:41:32 (GMT) |
commit | bffb54bb4c5864007e632475185e6b22e650074f (patch) | |
tree | f120735505e752df5879a42f8ae9e177cffca6a8 /src/FbTk | |
parent | 9348d192f6031b911cceb8ede31aadb9d184b2a3 (diff) | |
download | fluxbox_pavel-bffb54bb4c5864007e632475185e6b22e650074f.zip fluxbox_pavel-bffb54bb4c5864007e632475185e6b22e650074f.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 700ef1a..01744bf 100644 --- a/src/FbTk/LuaUtil.cc +++ b/src/FbTk/LuaUtil.cc | |||
@@ -115,4 +115,13 @@ void Lua::readOnlySet(int index) { | |||
115 | pop(); | 115 | pop(); |
116 | } | 116 | } |
117 | 117 | ||
118 | void Lua::readOnlySetField(int index, const char *k) { | ||
119 | checkstack(1); | ||
120 | index = absindex(index); | ||
121 | |||
122 | pushstring(k); | ||
123 | insert(-2); | ||
124 | readOnlySet(index); | ||
125 | } | ||
126 | |||
118 | } // namespace FbTk | 127 | } // namespace FbTk |
diff --git a/src/FbTk/LuaUtil.hh b/src/FbTk/LuaUtil.hh index d013ed9..0b33040 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 | template<typename Functor> | 57 | template<typename Functor> |
57 | static void registerInitFunction(const Functor &fn) { | 58 | static void registerInitFunction(const Functor &fn) { |