X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0c133e13b36a923c65f94499554e432bc3a0daa..80ce465c64d6f250e26cd69e62671a189302e897:/include/wx/persist.h diff --git a/include/wx/persist.h b/include/wx/persist.h index a46935fd90..68097fbcbe 100644 --- a/include/wx/persist.h +++ b/include/wx/persist.h @@ -239,5 +239,15 @@ inline bool wxPersistentRegisterAndRestore(T *obj) } +// A helper function which also sets the name for the (wxWindow-derived) object +// before registering and restoring it. +template +inline bool wxPersistentRegisterAndRestore(T *obj, const wxString& name) +{ + obj->SetName(name); + + return wxPersistentRegisterAndRestore(obj); +} + #endif // _WX_PERSIST_H_