Web lists-archives.com

Re: Cross-compiling GTK+, missing icons

Hi, maybe your previous thread was one that I initiated.  The reply was nogo or use a docker.  I'm wondering if you managed to generate a Win.exe that ran without loading any extras on all versions of windows?  I'm sure what I was doing would work only with the exact compile version even on the same distro version.  Regards Ian.

On 28/05/17 12:09 PM, Gerardo Ballabio wrote:
It looks like no moderators are actually _reading_ this list...
Resending without attachments.

2017-05-23 22:54 GMT+02:00 Gerardo Ballabio <gerardo.ballabio@xxxxxxxxx>:
Hello all,

I'm trying to cross-compile GTK+ for Windows on Linux (Debian) using MXE (http:/mxe.cc/). My goal is to produce a statically linked executable that just runs without having to install anything else (libraries, themes, etc.). I saw that in a previous thread someone said that GTK+ can't be statically linked, but that isn't true, it actually works fine (at least on Windows).

There is only one thing that doesn't work: the icons that are part of the standard interface (for example, the "+" and "-" that appear on the buttons of a GtkSpinButton) aren't displayed. When I run it, the program prints a warning saying that it can't find the "hicolor" theme, and all icons are replaced by a "missing icon" symbol.

I suppose that if I installed the theme on the target system, it would work (although I'm not sure in which directories GTK+ looks for it). But as I wrote above, I want the icons to be embedded in the executable, so that one can just download the file and run it. That is definitely possible with GTK+ 2, I compiled several programs and they all work without issues. But I haven't been able to make it work with GTK+ 3, so I'm asking for your help.

The problem is demonstrated by the attached screenshots:
- a window containing a GtkSpinButton (spinbutton-gtk3.png)
- a window containing a GtkToolbar with two buttons (toolbar-gtk3.png)
- the latter program rewritten for GTK+ 2 (toolbar-gtk2.png). As you can see, here the icons are displayed correctly.
I'm also attaching the source code of those examples.

I've tried to dig into the GTK+ sources to find where the icons are generated, but got lost. I found that there's a program called gtk-update-icon-cache that I guess might have to do with that, but I didn't understand how it's supposed to be used and where it's called during the build process (if it's called at all).

To reproduce what I did, go to http:/mxe.cc/ and follow the instructions. The GTK+ 3 library is configured with the following options (specified in the src/gtk3.mk file in the MXE source tree):

--disable-glibtest --disable-cups --disable-test-print-backend --disable-gtk-doc --disable-man --with-included-immodules --enable-win32-backend

MXE also applies a few patches to the GTK+ sources (file src/gtk3-1-fixes.patch).

Thank you in advance for any help that you can provide.


gtk-list mailing list

gtk-list mailing list