summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-10 21:12:27 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-10 21:12:27 +0000
commit94ac942ee0c1e59cb7431580792ea3960d5fe8ff (patch)
treebd90af6ed1cbd2d1ca6a17d1e4bbbb4be3ab4c92
parentdbebfb7ec024599a1ef50c11692bb81506bc1347 (diff)
MirLua: add some examples
git-svn-id: http://svn.miranda-ng.org/main/trunk@14109 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MirLua/docs/examples/core.lua15
-rw-r--r--plugins/MirLua/docs/examples/menus.lua3
2 files changed, 17 insertions, 1 deletions
diff --git a/plugins/MirLua/docs/examples/core.lua b/plugins/MirLua/docs/examples/core.lua
new file mode 100644
index 0000000000..58d3863543
--- /dev/null
+++ b/plugins/MirLua/docs/examples/core.lua
@@ -0,0 +1,15 @@
+-- core module (m) is included by default
+-- include m_genmenu module
+-- include m_icolib module
+local genmenu = require('m_genmenu')
+local icolib = require('m_icolib')
+
+-- Add icon for menu items
+local hRestartIcon = icolib.AddIcon('testMenuIcon', 'Lua icon for menus')
+
+
+-- Subscribe to [[Miranda/System/ModulesLoaded]] event
+m.OnModulesLoaded(function()
+ -- Add menu item to main menu that allow to restart Miranda NG
+ genmenu.AddMainMenuItem("Restart", 0, 0, hRestartIcon, "Miranda/System/Restart")
+ end)
diff --git a/plugins/MirLua/docs/examples/menus.lua b/plugins/MirLua/docs/examples/menus.lua
index 90ace6f6d9..aee6ab8559 100644
--- a/plugins/MirLua/docs/examples/menus.lua
+++ b/plugins/MirLua/docs/examples/menus.lua
@@ -1,5 +1,6 @@
---- include m_menus module
+--- include m_genmenu module
local genmenu = require('m_genmenu')
+--- include m_icolib module
local icolib = require('m_icolib')
--- Add icon for menu items