2

I was having temporary difficulties setting the icon of a window in my C program to a stock icon, and I almost asked how to do it, but then I created the GdkPixbuf I needed like this:

gtk_widget_render_icon(GTK_WIDGET(window),GTK_STOCK_CONVERT,-1,NULL)

The last argument is described by the documentation as "render detail to pass to theme engine. [allow-none]" (here). Since I have no idea what an appropriate value for that might be, I set it to NULL and hoped it would work. It did work, but now I want to know why.

What is this value supposed to be? Is there any possible repercussion if I leave it as NULL?

Wutaz
  • 362
  • 3
  • 19
  • What version of Gtk are you using? – MrEricSir Sep 20 '13 at 01:37
  • I'm using both GTK2 and GTK3, and I think this applies to both of them. The documentation was referring to GTK3, as the URL indicates. – Wutaz Sep 20 '13 at 23:40
  • I guess in that case I'd point out that the manual has a big warning indicating that this is a deprecated function. Since the replacement function doesn't have this parameter, I think it's safe to assume that this parameter is specific to the Gtk2 theme engine. – MrEricSir Sep 20 '13 at 23:52

1 Answers1

1

From the documentation you linked to:

detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.

The way I interpret that is that you might set it to "Wutaz-window-icon" and then if theme writers needed to write a special case for your application, they could match that string.

However, the point is moot; as @MrEricSir points out, the function is deprecated.

ptomato
  • 56,175
  • 13
  • 112
  • 165