diff options
-rw-r--r-- | plugins/MirLua/docs/examples/core.lua | 15 | ||||
-rw-r--r-- | plugins/MirLua/docs/examples/menus.lua | 3 |
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 |