Re: [gtkmm] gtkmm resources



Luis Pastor Vegas wrote:

Hi,

I'm new using gtkmm and I would like to know how to configure the properties of a customized class, e.g. MyLabel that derives from Gtk::Label, to change its default font, font size, background, etc, from a resource file. I don't know how to apply themes for a simple gtkmm application (not gnome application). I'm first using gtkmm without knowing anything about GTK+ and perhaps this is my problem. I've reviewed the gtkmm documentation and I haven't found any clue.

Thank you for your help,
Luis

Ok. I have already learnt that I have to use the Gtk::RC class, and reading the GTK+ documentation I am somewhat familiar to the resource file format. I have created two styles in the gtkrc file, but only the "default" style works. This is my gtkrc file:
----
style "default" {
   font_name = "Sans 14"
}
class "*" style "default"

style "my-label" {
   font_name = "Sans Italic 10"
}
class "MyLabel" style "my-label"
----
In the "MyLabel" constructor there is a call to set_name("MyLabel"). What's wrong? I don't know how is the class path format that must be specified in a gtkmm application, since the only documentation I have found is for GTK+ applications. Can anybody send me a gtkrc example file?

Thank you very much.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]