D
D
Dmitry Korolev2016-01-28 20:46:22
linux
Dmitry Korolev, 2016-01-28 20:46:22

How to apply visual styles in a MONO GTK project?

There is a test project, on GTK(Mono), I want to change the design of the form, but nothing happens!
I'm trying to change the design by connecting a file with styles, the file connection is successful, but the styles are not applied!
the drop-down menu changes at most and that's it ( see screenshot )
imgur.com/LvpXVSY "before" and "after" gtkrc file itself pastebin.com/7quHiELs Generated stetic file from designer pastebin.com/a2YtbdjR


Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Korolev, 2016-01-29
@ArchLord42

Found the problem:
Here is the code that MONO generates after creating the project

Gtk.Application.Init (); 
MainWindow win = new MainWindow ();
win.Show (); 
Gtk.Application.Run ();

The trick is that calling the win.Show() method; is absolutely not needed here, because it is already contained in the MainWindow constructor, it turns out it is called 2 times, and I parsed the styles just before win.Show (); when, in theory, the window had already opened (from the constructor), so they were not used, I threw the whole thing into the constructor, it all worked!)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question