add SetNativeTheme() (slightly modified patch 1884553)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-02-27 17:46:14 +00:00
parent 28dd9a9d03
commit c50c6fb23b
5 changed files with 43 additions and 1 deletions

View File

@@ -251,6 +251,30 @@ wxApp::~wxApp()
{
}
bool wxApp::SetNativeTheme(const wxString& theme)
{
wxString path;
path = gtk_rc_get_theme_dir();
path += "/";
path += theme.utf8_str();
path += "/gtk-2.0/gtkrc";
if ( wxFileExists(path.utf8_str()) )
gtk_rc_add_default_file(path.utf8_str());
else if ( wxFileExists(theme.utf8_str()) )
gtk_rc_add_default_file(theme.utf8_str());
else
{
wxLogWarning("Theme \"%s\" not available.", theme);
return false;
}
gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE);
return true;
}
bool wxApp::OnInitGui()
{
if ( !wxAppBase::OnInitGui() )