Re: rc files




Javi Roman <javi@hardlogic.es> writes:

[...]
>     label1 = gtk_label_new ("Label Style_normal");
>   	gtk_box_pack_start (GTK_BOX (vbox), label1, FALSE, FALSE, 0);
> 	gtk_widget_show (label1);
> 
> 	label2 = gtk_label_new ("Label Style_1");
> 	gtk_widget_set_name(label2, "Style_1");
>   	gtk_box_pack_start (GTK_BOX (vbox), label2, FALSE, FALSE, 0);
> 	gtk_widget_show (label2);
> 
> 	label3 = gtk_label_new ("Label Style_2");
> 	gtk_widget_set_name(label3, "Style_2");
>   	gtk_box_pack_start (GTK_BOX (vbox), label3, FALSE, FALSE, 0);
> 	gtk_widget_show (label3);

[...]

> filerc------------------------------------
> 
> style "Label1_style"
> {
>   font = "-adobe-helvetica-bold-r-normal--12-*-*-*-*-*-*-*"
> }
> 
> style "Label2_style"
> {
>   font = "-adobe-helvetica-bold-r-normal--18-*-*-*-*-*-*-*"
> }
> 
> widget "Style_1.GtkLabel" style "Label1_style"
> widget "Style_2.GtkLabel" style "Label2_style"

The 'widget PATTERN style STYLE' matches PATTERN
against the path for each widget.

The paths for a widgeta are composed of the widget 
and its parents names, or their class names if no
name is assigned.

In this case, that means that the paths for label2
and label3 are:

 GtkWindow.GtkVBox.Style_1
 GtkWindow.GtkVBox.Style_2

So, what you wanted was

 widget "*.Style_1" style "Label1_style"
 widget "*.Style_2" style "Label2_style"

See:
 
 http://developer.gnome.org/doc/API/gtk/gtk-resource-files.html

In particular, the section title "Pathnames and patterns".

Regards,
                                        Owen






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