forked from AuroraMiddleware/gtk
icontheme: Adapt a code sample to the GdkPaintable transition
This commit is contained in:
parent
c0827e2c54
commit
32cec6c1cb
@ -82,23 +82,23 @@
|
|||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
* GError *error = NULL;
|
* GError *error = NULL;
|
||||||
* GtkIconTheme *icon_theme;
|
* GtkIconTheme *icon_theme;
|
||||||
* GdkPixbuf *pixbuf;
|
* GdkPaintable *paintable;
|
||||||
*
|
*
|
||||||
* icon_theme = gtk_icon_theme_get_default ();
|
* icon_theme = gtk_icon_theme_get_default ();
|
||||||
* pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
* paintable = gtk_icon_theme_load_icon (icon_theme,
|
||||||
* "my-icon-name", // icon name
|
* "my-icon-name", // icon name
|
||||||
* 48, // icon size
|
* 48, // icon size
|
||||||
* 0, // flags
|
* 0, // flags
|
||||||
* &error);
|
* &error);
|
||||||
* if (!pixbuf)
|
* if (!paintable)
|
||||||
* {
|
* {
|
||||||
* g_warning ("Couldn’t load icon: %s", error->message);
|
* g_warning ("Couldn’t load icon: %s", error->message);
|
||||||
* g_error_free (error);
|
* g_error_free (error);
|
||||||
* }
|
* }
|
||||||
* else
|
* else
|
||||||
* {
|
* {
|
||||||
* // Use the pixbuf
|
* // Use the icon
|
||||||
* g_object_unref (pixbuf);
|
* g_object_unref (paintable);
|
||||||
* }
|
* }
|
||||||
* ]|
|
* ]|
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user