From: John L. <jla...@gm...> - 2008-11-25 15:43:12
|
On Tue, Nov 25, 2008 at 8:04 AM, arpin <ar...@ki...> wrote: > How to reproduce: > > change > gridtable.GetTypeName = function( self, row, col ) > if col == Col_Id or col == Col_Priority then > return wx.wxGRID_VALUE_NUMBER > > to > gridtable.GetTypeName = function( self, row, col ) > if col == Col_Id or col == Col_Priority then > return wx.wxEmptyString > > I realize that this is not a type but this is purely to demonstrate the > problem I found it in a more complex situation. > > Returning '' will properly report the error it seems to be related to > wx.wxEmptyString. > > Hope someone can figure out how to fix the problem This is always going to be a problem I imagine. wxLua merely wraps wxWidgets and doesn't rewrite it. Therefore, when you return nil, but a string is expected, a lua_error is thrown (actually a long jump) and the C++ stack is corrupted since we're in a virtual C++ function handling your Lua function. A good fix for this would take a lot of work and make updating to new versions of wxWidgets very painful since they would have to be done by hand. You do get an error stating that a string was expected right? The best I can say is take heed of the error message and return a string! Regards, John |