|
From: Éjjeli Ő. <ejj...@gm...> - 2009-01-30 15:16:16
|
Thanks for the reply, here is a code which demonstrate the error:
require "wx"
myApp = wx.wxFrame(wx.NULL,-1,"Testing
HtmlEasyPrinting",wx.wxDefaultPosition,wx.wxSize(200,100))
btn = wx.wxButton(myApp,-1,"Press me")
btn:Connect(wx.wxEVT_COMMAND_BUTTON_CLICKED,function(event)
sHTML = [[<html><body>Please close this preview. After you closed, and you
want to exit from the application, it will throw an error.</body></html>]]
hep = wx.wxHtmlEasyPrinting("My print's preview",myApp)
hep:SetHeader("@PAGENUM@/@PAGESCNT@. page")
prnSetup = hep:GetPageSetupData()
prnData = prnSetup:GetPrintData()
prnData:SetNoCopies(3)
tMinoseg =
{wx.wxPRINT_QUALITY_DRAFT,wx.wxPRINT_QUALITY_LOW,wx.wxPRINT_QUALITY_MEDIUM,wx.wxPRINT_QUALITY_HIGH}
prnData:SetQuality(2)
prnSetup:SetMarginTopLeft(wx.wxPoint(12,12))
prnSetup:SetPrintData(prnData)
hep:PreviewText(sHTML)
end)
myApp:Connect(wx.wxEVT_CLOSE_WINDOW,
function(event)
myApp:Destroy()
wx.wxExit(0)
event:Skip()
end)
myApp:Centre()
myApp:Show(true)
wx.wxGetApp():MainLoop()
Hope this helps (I made everything global, so this can't be the problem)
|