On 15.11.2013 at 23:37 John Labenski wrote:

> On Fri, Nov 15, 2013 at 5:34 PM, Andreas Falkenhahn 
> <andr...@falkenhahn.com>wrote:
>  
> On 15.11.2013 at 23:28 John Labenski wrote:
>  
 >> You are supposed to use myButton:Destroy() to let wxWidgets
 >> properly delete it. The delete() function is available only for
 >> objects that are not owned by something else. It works on wxRects
 >> for example, but all wxWindows are supposed to be owned by their parent.
>  
>  Ok, but is myButton:Destroy() really equivalent to doing a "delete myButton"
>  in C++? I ask because I'm porting some C++ code to wxLua and the code
>  often deletes and then re-creates the button and I'm trying to imitate
>  this behaviour in wxLua....
>  





> Your C++ code is doing the wrong thing, the wxWidgets manual
> explicitly ask you to use Destroy() and not delete. You can call
> Show(false) if you want to make sure it is immediately hidden from the user 
> (if necessary).
>  
> http://docs.wxwidgets.org/trunk/classwx_window.html#a6bf0c5be864544d9ce0560087667b7fc

Ok.... but it's strange that the code I'm talking about is actually official 
example code
by the wxWidgets authors! I'm talking about the Widgets Demo from this page:

http://www.wxwidgets.org/downloads/demos.htm

(second demo from the top)

It uses delete on the objects all the time... strange...

-- 
Best regards,
 Andreas Falkenhahn                            mailto:andr...@falkenhahn.com


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to