Web lists-archives.com

Create exact copy of GtkStyleContext




Hi All,

 

I am trying to make an exact copy of a GtkStyleContext. I want to know what all things are stored in GtkStyleContext which I should copy. As of now, I have copied the GtkWidgetPath and GtkStateFlags as shown in below. It looks like I am missing something as the output style for the two context is not same as the text color is coming different for two contexts.

 

 

// I am creating copy of widget_context as context. gtk3_widget is some GtkWidget.

 

GtkStyleContext* widget_context = gtk_widget_get_style_context (gtk3_widget);

GtkWidgetPath *path = createWidgetPath (gtk_style_context_get_path (widget_context));

 

GtkStyleContext *context = gtk_style_context_new ();

gtk_style_context_set_path (context, path);

gtk_widget_path_unref (path);

 

gtk_style_context_set_state (context, gtk_style_context_get_state (widget_context));

return context;

 

 

Please let me know when I am missing here. Are classes part of GtkWidgetPath or I need to copy the Style classes separately?

 

-Pankaj

 

_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list