11/30/2023 0 Comments Page layers appapp.msgbox displays a message box with the specified buttons and returns the button clicked by the user.Those are defined in theĬurrently the list contains the following functions: The Lua Plugin can execute a number of Xournal++ functions to interact with Xournal++. Such errors to lua errors by wrapping with assert. Reserved for expected things (like the resource is unavailable). Nil, errorMessage might be returned to silently throwing an error. Unexpected happens (like wrong arguments passed). Plugin API ¶ Error-handling ¶įunctions of the xounalpp lua-Api will return lua errors which can be handled by registerUi () - TO CHANGE THE COLOR OF THE CURRENT TOOL TO RED endįor more extensive examples of plugins, you can check out the code of the plugins bundled with Xournal++ in the repository. Register all Toolbar actions and intialize all UI stuff function initUi () app. You can register multiple menu entires/accelators in the same plugin by using app.registerUi multiple times.Ī sample file for the main Lua code file is: a ¶ Using accelerators without modifiers like (, , ) is allowed, but will likely break the text tool. The format looks like a or F1, see GTK4 reference for details. the accelerator used to execute the plugin callback function. the callback function used when the plugin is called from the menu or via a keyboard accelerator,.the menu name displayed in Xournal++'s menubar,.It is supposed to call the app.registerUi-function, whose argument is a Lua table containing The Lua code file referenced in the plugin.ini file must define an initUi-function that registers toolbar actions and initializes all UI stuff. # Author / Copyright notice author = NAME OF THE AUTHOR description = DESCRIPTION OF THE PLUGIN # If the plugin is packed with Xournal++, use # then it gets the same version number version = enabled = false mainfile = a A sample file (referencing a) is: plugin.ini ¶ Or not and a reference to the main Lua code file. The plugin.ini file contains the name of the author, the version number, info on whether it is enabled by default Create the plugins subfolder manually, ifĮach plugin has its files stored in a subfolder of the plugin folder and containsĪt least a plugin.ini file and a Lua code file. In the latest development version, custom plugins can be stored in the plugins subfolder Plugins shipped with Xournal++ reside in the same folder, the plugins subfolder of the Note that a restart of Xournal++ is required to change the activation of a plugin. Only activated plugins will be listed in the menubar and only those can be run. The Plugin manager lists the installation folder, description, author and version for each plugin. Plugins must be activated or deactivated in the Plugin manager (from menu Plugin > Plugin manager). In order to use Lua Plugins make sure you have Lua (version >=5.3) installed on your device. In general the Lua Plugin interface is still in an early stage and will be expanded over time. Their primary use is to add user-specific functionality, shortcuts, make calls to external programs, define user-specific export functions and the like. Plugins can be added without building Xournal++ from source. Xournal++ provides a basic Lua Plugin interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |