On Thu, Aug 16, 2012 at 10:56 PM, Paul K <[email protected]> wrote:
> Hi all,
>
> I'm working with an application that saves data in files and some of
> the operations may trigger file errors. I'm handling those errors
> myself and don't want to see the standard error message shown by
> wxwidgets. How do I disable it? Here is the code that I have:
>
>   local file = wx.wxFile(filename, wx.wxFile.write)
>   file:Write("something", #"something")
>
> If the file is write protected, I get "can't open file '...' (error 5:
> access is denied)". I know, I can check for that condition, but this
> is not what the question is about. I'd like to disable that message.
>
> 1. use wxLogNull. I read C++ examples, but not sure how this should be
> used in wxlua (according to examples, you just need to "instantiate"
> this logNull object):

This does not show the error dialog for me in Linux.

local log = wx.wxLogNull()
local file = wx.wxFile("/aaa", wx.wxFile.write)
print(file:IsOpened())
if (file:IsOpened())
     -- This asserts as it should if the file is not opened
     file:Write("something", #"something")
end()
log:delete()

Regards,
    John

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to