how to make gtk_rc_get_style_by_paths() return not NULL?
- From: Vitaly Tishkov <tvv sparc spb su>
- To: gtk-list gtk org
- Subject: how to make gtk_rc_get_style_by_paths() return not NULL?
- Date: Tue, 17 Sep 2002 18:11:22 +0400
Hi,
How to make gtk_rc_get_style_by_paths() return not NULL?
How to change my example below?
Thanks,
    Vitaly.
Example:
#include <gtk/gtk.h>
int
main (int argc, char** argv)
{
    GtkWidget* widget;
    GtkWidget* window;
    GtkStyle* style;
    gchar* path = NULL;
    gchar* class_path = NULL;
    gtk_init (&argc, &argv);
    widget = gtk_arrow_new (GTK_ARROW_UP, GTK_SHADOW_IN);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_container_add (GTK_CONTAINER (window), widget);
    if (TRUE)
    {
        gtk_widget_path (widget, NULL, &path, NULL);
        gtk_widget_class_path (widget, NULL, &class_path, NULL);
    }
    style = gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
                                       path, class_path,  G_OBJECT_TYPE
(widget));
    if (!style)
    {
        printf ("\nstyle is %p, widget style = %p\n", style,
                gtk_rc_get_style (widget));
        printf ("path = '%s', class_path = '%s'\n", path, class_path);
    }
    if (widget)
        gtk_widget_destroy (widget);
}
Output:
style is (nil), widget style = 0x8068d80
path = 'GtkWindow.GtkArrow', class_path = 'GtkWindow.GtkArrow'
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]