Icon lookup tester
/* | |
* Build: | |
* gcc $(pkg-config --cflags gtk+-3.0) icon_tester.c -o icon_tester $(pkg-config --libs gtk+-3.0) | |
*/ | |
#include <gtk/gtk.h> | |
int main (int argc, char *argv[]) | |
{ | |
gtk_init (&argc, &argv); | |
if (argc <= 1) { | |
g_print ("Please inform the icon name\n"); | |
return 1; | |
} | |
GtkIconTheme *theme = gtk_icon_theme_get_default (); | |
GtkIconInfo *info = gtk_icon_theme_lookup_icon (theme, argv[1], 32, 0); | |
if (info == NULL) { | |
g_print ("Icon '%s' not found\n", argv[1]); | |
} else { | |
g_print ("%s\n", gtk_icon_info_get_filename (info)); | |
g_object_unref (info); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment