Create exact copy of GtkStyleContext
- Date: Fri, 1 Mar 2019 08:38:25 -0800 (PST)
- From: Pankaj Bansal via gtk-devel-list <gtk-devel-list@xxxxxxxxx>
- Subject: Create exact copy of GtkStyleContext
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_style_context_set_state (context, gtk_style_context_get_state (widget_context));
Please let me know when I am missing here. Are classes part of GtkWidgetPath or I need to copy the Style classes separately?
_______________________________________________ gtk-devel-list mailing list gtk-devel-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-devel-list