[racket] Trying to build first GUI executable and the application icon file

From: Jeff C. Britton (jcb at iteris.com)
Date: Tue Nov 15 22:18:01 EST 2011

I am on Windows XP.
I am having trouble with the main window icon and the application icon.

The following embeds camera.ico into my executable as the application icon.

raco exe --gui --ico camera.ico gui1.rkt

On my main window frame I wish to set the icon to this embedded camera.ico.

I can set the main window frame icon with this.
(send frame set-icon icon)

But there are a couple of problems.  
icon must be a bitmap and read-bitmap does not read .ico files.

I don't know how to read a file(resource) from the executable.
I don't know how to embed a .png file into the executable as a resource and then read this from the application.
I don't know how to work effectively in interactive design mode where the file is not in an executable versus run-time where the file is in an executable.  
Does scheme have some kind of #ifdef or environment variable that can be tested for interactive mode versus .exe mode?  Like Python has
if __name__ == '__main__':

 





Posted on the users mailing list.