Mercurial > pidgin
comparison src/util.c @ 3649:f09193608fd3
[gaim-migrate @ 3773]
Really, I think this is a lot prettier.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sat, 12 Oct 2002 01:30:44 +0000 |
parents | 5e50f6746509 |
children | 5b82f99d028d |
comparison
equal
deleted
inserted
replaced
3648:1e8c10125558 | 3649:f09193608fd3 |
---|---|
1407 } | 1407 } |
1408 | 1408 |
1409 | 1409 |
1410 return NULL; | 1410 return NULL; |
1411 } | 1411 } |
1412 | |
1413 GtkWidget *gaim_pixmap(char *subdir, char *iconfile) { | |
1414 char *filename; | |
1415 GtkWidget *image; | |
1416 | |
1417 if (subdir != NULL) | |
1418 filename = g_build_filename (DATADIR, "pixmaps", "gaim", subdir, iconfile, NULL); | |
1419 else | |
1420 filename = g_build_filename (DATADIR, "pixmaps", "gaim", iconfile, NULL); | |
1421 | |
1422 debug_printf("Loading: %s\n", filename); | |
1423 | |
1424 image = gtk_image_new_from_file(filename); | |
1425 | |
1426 g_free(filename); | |
1427 | |
1428 return image; | |
1429 } | |
1430 | |
1431 GdkPixbuf *gaim_pixbuf(char *subdir, char *iconfile) { | |
1432 char *filename; | |
1433 GdkPixbuf *pixbuf; | |
1434 GError *err = NULL; | |
1435 | |
1436 if (subdir != NULL) | |
1437 filename = g_build_filename (DATADIR, "pixmaps", "gaim", subdir, iconfile, NULL); | |
1438 else | |
1439 filename = g_build_filename (DATADIR, "pixmaps", "gaim", iconfile, NULL); | |
1440 | |
1441 debug_printf("Loading: %s\n", filename); | |
1442 | |
1443 pixbuf = gdk_pixbuf_new_from_file(filename, &err); | |
1444 if (!pixbuf) { | |
1445 /* FIXME: Maybe we should handle this error */ | |
1446 g_error_free(err); | |
1447 } | |
1448 | |
1449 g_free(filename); | |
1450 | |
1451 return pixbuf; | |
1452 } |