3

It appears that in gtk4, the gtk_style_context_get_property() function is gone: https://developer.gnome.org/gtk4/stable/GtkStyleContext.html .

I can't seem to find any functions in gtk4 that do what it did. Basically I want to get the border color set by the current theme for a specific widget class and use it in my own custom widget.

1 Answers1

0

There is no direct replacement. GtkStyleContext is now deprecated in GTK 4.10+ and slated to be removed in GTK5. Access to style contexts is viewed as a holdover from the GTK 2-to-3 migration, to make that easier for developers, but not something that is being retained long-term, as it makes widget impls harder to reason about.

If you want a custom widget to render a border like standard GTK widgets, you should define that in your CSS.

underscore_d
  • 6,309
  • 3
  • 38
  • 64