Allow expanding environment variables in XRC file paths
Add a new flag wxXRC_USE_ENVVARS for wxXmlResourceFlags that triggers a call to wxExpandEnvVars() for bitmap, icon and animation paths. This flag is not set by default to avoid silently changing the behaviour of existing applications. Closes https://github.com/wxWidgets/wxWidgets/pull/1445
This commit is contained in:
@@ -90,6 +90,10 @@ bool MyApp::OnInit()
|
||||
// wxXRC docs for details.
|
||||
wxXmlResource::Get()->InitAllHandlers();
|
||||
|
||||
// Allow using environment variables in the file paths in the resources,
|
||||
// while keeping the default wxXRC_USE_LOCALE flag.
|
||||
wxXmlResource::Get()->SetFlags(wxXRC_USE_LOCALE | wxXRC_USE_ENVVARS);
|
||||
|
||||
#if wxUSE_RIBBON
|
||||
wxXmlResource::Get()->AddHandler(new wxRibbonXmlHandler);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user