Changeset 730

Show
Ignore:
Timestamp:
06/05/09 16:37:56 (15 months ago)
Author:
ghoulsblade
Message:

pcall for GUI_TriggerWidgetEventCallback

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lugre/lua/lib.gui.lua

    r699 r730  
    9191        local callback_name = "on_"..sEventName  -- e.g. widget.on_mouse_left_down 
    9292        local callback = widget[callback_name] 
    93         if (callback) then callback(widget) return end 
     93        if (callback) then  
     94                local success,errormsg_or_result = lugrepcall(callback,widget) 
     95                if (not success) then NotifyListener("lugre_error","error in GUI_TriggerWidgetEventCallback",sEventName,"\n",errormsg_or_result) end 
     96                return 
     97        end 
     98         
    9499        if (widget.GetParent) then return GUI_TriggerWidgetEventCallback(widget:GetParent(),sEventName) end -- guisys2 
    95100