[no subject]



Hi,
 
In my working folder where my application button.c is, I have a .gtkrc file.
which contains only one line.
 
include "/usr/......./gtk/gtkrc 
 
I think my GTK+ applications are using gtkrc from the above path.
I can't modify this gtkrc due to some access permissions so
I have added a code just above it. now my new .gtkrc file looks like this.
---------------------------------------------------------------------------------------------------------
style "red_style" = "default"
{
        bg[NORMAL] = "#C1665A"
        bg[PRELIGHT] = "#E0B6AF"
        bg[ACTIVE] = "#C1665A"
        bg[SELECTED] = "#C1665A"
        bg[INSENSITIVE] = "#884631"
}
widget "*red_widget" style "red_style"
include "/usr/..../gtk/gtkrc
----------------------------------------------------
in my button.c, I have added this code.
 
#include <gtk/gtk.h>
 
set_name( GtkWidget *widget, const char *name )
{
        gtk_widget_set_name( widget, name );
        if( GTK_IS_CONTAINER( widget ) )
                gtk_container_foreach( GTK_CONTAINER( widget ),
                           (GtkCallback) set_name, (char *) name );
}
int main (int argc, char *argv[])
{
        GtkWidget *window, *button;
        gtk_init (&argc, &argv);
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
        gtk_window_set_default_size (GTK_WINDOW (window), 100, 100);
        button = gtk_button_new_with_label ("OK");
 
        set_name (button, "red_widget");
 
        gtk_container_add (GTK_CONTAINER(window), button);
 
        gtk_widget_show (button);
        gtk_widget_show (window);
        gtk_main ();
        return 0;
}
even now also I'm getting the default colors for button background..
 
Is it I'm doing something wrong in my .gtkrc file?

both button.c and .gtkrc file is in $HOME/prasanna.

 


 
 
 
Regards,
prasanna.

This message (including any attachment) is confidential and may be legally privileged. Access to this message by anyone other than the intended recipient(s) listed above is unauthorized. If you are not the intended recipient you are hereby notified that any disclosure, copying, or distribution of the message, or any action taken or omission of action by you in reliance upon it, is prohibited and may be unlawful. Please immediately notify the sender by reply e-mail and permanently delete all copies of the message if you have received this message in error.



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