+ // try stock GTK+ icon first
+ GdkPixbuf *pixbuf = CreateStockIcon(icon_name, stock_size);
+ if ( pixbuf )
+ return pixbuf;
+
+ // if that fails, try theme icon
+ wxSize size(pixel_size);
+ if ( pixel_size == wxDefaultSize )
+ gtk_icon_size_lookup(stock_size, &size.x, &size.y);
+ return CreateThemeIcon(icon_name, size.x);
+}
+
+template<typename SizeType, typename LoaderFunc>
+wxIconBundle DoCreateIconBundle(const char *stockid,
+ const SizeType *sizes_from,
+ const SizeType *sizes_to,
+ LoaderFunc get_icon)
+
+{
+ wxIconBundle bundle;
+
+ for ( const SizeType *i = sizes_from; i != sizes_to; ++i )