In the documentation it states that by default, wxEvtHandler and wxWindow derive from wxTrackable. However, wxObject does not.
Indeed, if I attempt to assign a wxMenu pointer to a wxWeakRef<wxMenu> it works however if I attempt to assign a wxMenuItem pointer to a wxWeakRef<wxMenuItem> it does not and an error occurs at compile time because a static_cast fails somewhere in the depths of wxWidgets.
Is there a reason that wxObject does not derive from wxTrackable so that every class will "just work" with wxWeakRef?
I am terrible with raw pointers and like to use weak / shared wrappers whenever possible
I would currently have to hack at the source code to add a wxTrackable base class to wxObject and modify all instances of classes deriving from both wxObject and wxTrackable to remove the "inheritance ambiguous" compile errors.
Before I consider doing this, I just want to check if there are any other issues that I would encounter that I haven't thought of yet! Or is there a better solution?
Thanks
Reasoning behind wxObject not inheriting from wxTrackable?
Re: Reasoning behind wxObject not inheriting from wxTrackable?
Hi,
This forum is user-driven and is for users.
If you want an answer to you question - post to wx-dev ML.
Thank you.
This forum is user-driven and is for users.
If you want an answer to you question - post to wx-dev ML.
Thank you.