I have some problems using wxLua in LuaLateX.
This works:
lua simpleui.lua
(print instead of tex.print
)
But if I try this:
lualatex wx.tex
it doesn't work.
\documentclass{article}
\directlua{require("simpleui.lua")}
\usepackage{color}
\begin{document}
{\Huge\color{\ChoicewxRadioBox} Test!}
\end{document}
Error:
simpleui.lua
:
require("wx")
frame = nil
function HandleEvents(event)
local name = event:GetEventObject():DynamicCast("wxWindow"):GetName()
print(string.format("\\global\\def\\Choice%s{%s}", name, event:GetString()))
end
function main()
frame = wx.wxFrame(wx.NULL,
wx.wxID_ANY,
"Erstellen Sie Ihr PDF-Dokument mit LuaTeX",
wx.wxDefaultPosition,
wx.wxSize(185, 85),
wx.wxDEFAULT_FRAME_STYLE)
local panel = wx.wxPanel(frame, wx.wxID_ANY)
local choices = {"blue", "red", "green"}
local radioBox = wx.wxRadioBox(panel,
wx.wxID_ANY,
"Farbe",
wx.wxDefaultPosition,
wx.wxDefaultSize,
choices, 1,wx.wxRA_SPECIFY_ROWS)
frame:Connect(wx.wxID_ANY,
wx.wxEVT_COMMAND_RADIOBOX_SELECTED,
HandleEvents)
frame:Show(true)
end
main()
wx.wxGetApp():MainLoop()
The folder contains the following files:
lua51.dll
lua5.1.dll
simpleui.lua
wx.tex
wx.dll
I am using Lua 5.1 and LuaTeX beta-0.70.2 (MikTeX 2.9).
texlua simpleui.lua
doesn't work:
The example is on page 24:
http://www.dante.de/events/Archiv/dante2012/Programm/Vortraege/vortrag-meigen.pdf
Edit: I was able to compile the wxlua libs on Linux and it works, but i still haven't any solution for windows.
simpleui.lua
contain, and where is it located? IswxLua
a precompiled library? Which versions of Lua and luatex do you use?texlua simpleui.lua
? This will use same interpreter aslualatex
as opposed tolua
, which may be different version of interpreter. Also, what about running the gui with lua, generate the document on the fly and calllalatex
from here? I have a feeling that it would be easier to maintain.