File: main.lua

package info (click to toggle)
xournalpp 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,088 kB
  • sloc: cpp: 64,307; xml: 939; sh: 752; ansic: 362; python: 338; php: 74; makefile: 15
file content (24 lines) | stat: -rw-r--r-- 702 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- This is an example Xournal++ Plugin - copy this to get started

var_dump = require "var_dump"

-- Register all Toolbar actions and initialize all UI stuff
function initUi()
  print("Hello from Example: Plugin initUi called\n");

  ref = app.registerUi({["menu"] = "Test123", ["callback"] = "exampleCallback", ["accelerator"] = "<Control>t"});
  print("Menu reference:");
  var_dump(ref);

  print("Example plugin registered\n");
end

-- Callback if the menu item is executed
function exampleCallback()
  app.openDialog("Test123", {"Yes", "No"}, "dialogCallback");
end

-- Callback for when the user click one of the dialog's button
function dialogCallback(result)
  print("result = " .. result)
end