X11 icon change xbm to xpm
#include "gtk2/gtk_keyboard.h"
#include "gtk2/gtk_menu.h"
-#include "resources/np2.xbm"
+#include "resources/np2.xpm"
#define APPNAME "NP2"
@@ -210,12 +210,15 @@ main_loop_quit(gpointer p)
static void
set_icon_bitmap(GtkWidget *w)
{
- GdkPixmap *icon_pixmap;
+ GdkPixbuf *icon_pixbuf;
+ GList *pixbufs = NULL;
gdk_window_set_icon_name(w->window, APPNAME);
- icon_pixmap = gdk_bitmap_create_from_data(
- w->window, np2_bits, np2_width, np2_height);
- gdk_window_set_icon(w->window, NULL, icon_pixmap, NULL);
+ icon_pixbuf = gdk_pixbuf_new_from_xpm_data(np2_icon);
+ pixbufs = g_list_append(pixbufs, icon_pixbuf);
+ gdk_window_set_icon_list(w->window, pixbufs);
+ g_object_unref(icon_pixbuf);
+ g_list_free(pixbufs);
}
