From: John L. <jla...@gm...> - 2012-08-17 03:21:44
|
On Thu, Aug 16, 2012 at 10:56 PM, Paul K <pau...@ya...> 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 |