Re: Apply diferent styles to diferent own classes..

Benjamin Berg <[email protected]>
Newsgroups gmane.comp.gnome.themes
Message-ID <1186603102.30489.57.camel@localhost>
On Wed, 2007-08-08 at 09:45 +0200, Iker Perez de Albeniz wrote:
> El mar, 07-08-2007 a las 16:04 +0000, Benjamin Berg escribió:
> > Have you seen http://live.gnome.org/GnomeArt/Tutorials/GtkThemes ?
> > 
> 
> yes i have read it but (maybe becouse my bad english) it was a bit
> confused for me..

Hm, OK. It could probably be improved. (Though don't know how ...)

> [snip]
> #include <gtkmm.h>
> #include "mainWindow.h"
> 
> int main (int argc, char *argv[])
> {
> 
> 	Gtk::Main kit(argc, argv);
> 	
> 	Gtk::RC rc_style("./skin/gtkrc");
> 	Gtk::RC::reparse_all(); 
> 	
> 	mainWindow window;
> 	
> 	window.set_name("Principal");
> 	
> 	Gtk::Main::run(window);
> 	
> 	return 0;
> }
> ------------------------------------
> 
> then in mainWindow.cpp i define the name of a GtkHBox:
> 
> ------------------
> ...
> m_Box_Window.set_name("WindowBorder");
> m_Box_Window.set_size_request(700, 32);
> m_Box_Top.pack_start(m_Box_Window, Gtk::PACK_SHRINK);
> ...
> -----------------

Ah, so you are setting the name. And you don't have a custom subclass as
I first thought.

> and finaly in the gtkrc file y put the lines:
> 
> --------------------------------------------
> style "Aero-WindowBorder"
> {
> 
>   bg_pixmap[NORMAL] = "bg_menu.png"
> 
> }
> 
> widget_class "Principal.WindowBorder" 		style "Aero-WindowBorder"
> -----------------------------------------------
> 
> to set the backgroun of the HBox.. but deosn't work..

OK. As you are setting names on the widget, then the "widget" match is
what you want. Also, a box cannot have a background image set on it. You
will need to use a GtkEventBox or similar.

widget "*.WindowBorder" style "..."

But as said earlier, this will not change anything because the box does
not draw any background image.


Benjamin

PS: I guess you are trying to set a background image on some widgets. I
have no idea how people usually achieve this. But I see different
alternatives to parsing a gtkrc or modifying RC styles.
First setting the backing pixmap directly on an event box
(gdk_window_set_back_pixmap). Or even creating subclasses and overriding
the expose event of the container widget.

_______________________________________________
gnome-themes-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-themes-list
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGuiBdJddvdAxOva4RArpcAJ98aXg74zuYduUS6j0UrxClV0b9wgCfcEUS
2N3+KeADElMXeqrj3tlfqls=
=g7mG
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.