diff options
Diffstat (limited to 'plugins/MirLua/docs/examples/core.lua')
-rw-r--r-- | plugins/MirLua/docs/examples/core.lua | 15 |
1 files changed, 15 insertions, 0 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) |