Gtk theme in GTK# (Windows)

混江龙づ霸主 提交于 2019-12-01 18:00:11

I know it's an old question, but I've been fighting with themes lately.

It turns out that when running a Gtk# app build with Xamarin, theme issues will appear because it seems that some "Windows-like" theme is forced into the code.

When running the application from Xamarin Studio, depending on the .Net framework (Microsoft .NET 4.5, Mono 3.3.0, Mono 4.0.1) the behaviour was different. And I had a warning with Mono 3.3.0, telling me the 'Xamarin' engine could not be found.

I ended up with the following code :

Application.Init ();
Gtk.Settings.Default.ThemeName = "Theme/gtk-2.0/gtkrc";
Gtk.Rc.Parse ("./Theme/gtk-2.0/gtkrc");

Where gtkrc is my theme. Without setting the default theme name, nothing worked correctly. I didn't go very far into customizing my theme, so I can't tell if it solves every theme issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!