Gtk theme in GTK # (Windows)

I am trying to change the theme in GTK # ( OS: Windows, IDE: Xamarin ). But I get the following questions:

  • I was able to find only one topic that correctly displays, this is "Horta." Everything was fine, except for lags and freezes . Here is my code:

    string Resource_File = "Orta\\gtk-2.0\\gtkrc"; Application.Init (); Gtk.Rc.AddDefaultFile (Resource_File); Gtk.Rc.Parse (Resource_File); MainWindow win = new MainWindow (); win.Show (); Application.Run ();

    When I resize the Paned button or by clicking on the button, I get a GUI freeze ( I already asked about this ). This problem occurs only when using this theme, and the rest of the topics work with restraint. I used search and found a couple of opinions about the fact that this is related to using Cairo to render graphics ( one of them ).

  • if I try to use a different theme, there are many GUI elements that do not display correctly in my GTK # application, but they display correctly in the GTK Theme selector. If the theme displays correctly in GTK Theme Selector, I try to use the selected gtkrc file in my Gtk # application (as shown in the "Orta" example), but almost always most widgets do not display correctly ( here is an example )

So, I have a few questions:

  • How to choose a work topic?
  • How to install theme for GTK # (Windows)?
  • What is a Gtk # open source application using themes and how?
  • What is another way to change the GUI style in a GTK # application?
  • Why does the Horta theme freeze?

So I need your help! Thanks!

+5
source share
1 answer

I know this is an old question, but lately I've been struggling with topics.

It turns out that when you start building the Gtk # application with Xamarin, there will be problems with the themes, because it seems that some kind of "Windows-like" theme is being inserted into the code.

When starting the application from Xamarin Studio, depending on the .Net framework (Microsoft.NET 4.5, Mono 3.3.0, Mono 4.0.1), the behavior was different. And I had a warning with Mono 3.3.0 saying that the "Xamarin" engine was not 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 specifying the default theme name, nothing worked. I didn’t set up my theme very far, so I can’t understand if it solves every problem.

+2
source

Source: https://habr.com/ru/post/1205239/


All Articles