Application icon

26 views
Skip to first unread message

Phillip Pollard

unread,
Apr 20, 2012, 5:02:43 PM4/20/12
to citru...@googlegroups.com
I forget what horrible, outdated Wx tutorial I found this gem in, but on my base frame:

  $frame->SetIcon( Wx::GetWxPerlIcon() );

In windows, this produces a nice WxPerl icon on the application. In OsX it doesn't seem to work and you only have the generic application icon. (dark terminal)

For clarity, I am talking about the icons assigned in the various status bars while the application is running. NOT the icon for the .exe/.app on disk.

I'm not clear where this issue falls: Wx, Citrus, Cava, Apple, etc.

Any clue?

Citrus Support

unread,
Apr 20, 2012, 5:20:55 PM4/20/12
to citru...@googlegroups.com
Hi,

For a .app bundle you have to assign a .icns file as the application
icon. Cava will then setup the bundle for you. It is the icon on disk
that gets used for all the things you want on MacOSX.

That's just the way Mac OSX works I'm afraid.

Making a quick .icns file =

Get a square .png file that will render OK at 128 * 128 and do

sips -s format icns -z 128 128 mysource.png --out mytarget.icns


sips is a largely undocumented MacOSX utility.

Regards

Mark
> --
> You received this message because you are subscribed to the Google
> Groups "Citrus Perl" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/citrus-perl/-/7jDzsjpoZKUJ.
> To post to this group, send email to citru...@googlegroups.com.
> To unsubscribe from this group, send email to
> citrus-perl...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/citrus-perl?hl=en.

Phillip Pollard

unread,
Apr 30, 2012, 5:00:08 PM4/30/12
to citru...@googlegroups.com
Thanks! Setting the icon for the app bundle works great.

What I had noticed is the quoted code worked on the windows side to change the icon when running live (IE: not packaged as an app.) in the Citrus Perl interpreter. But not it does not for Osx. I wonder if there is a missing resource or such. 

- Phil

Citrus Support

unread,
Apr 30, 2012, 6:25:52 PM4/30/12
to citru...@googlegroups.com
Hi,
No. OSX always takes the icon from the application - which in this case
is Perl which has none. (isn't packaged as an 'app').

Packing a Perl interpreter as an app would be quite trivial.

you need a directory structure to drop a copy of the existing Perl exec
into.

Perl.app
Perl.app/Contents
Perl.app/Contents/MacOS
Perl.app/Contents/MacOS/perl
Perl.app/Contents/Info.plist
Perl.app/Contents/Resources/appicon.icns

Look at the Info.plist file for any Citrus packed app - and make a copy
changing the obvious paths

Then if you call Perl as

somepath/Perl.app/Contents/MacOS/perl

you should get appicon.icns as your application icon.

This is also one of the reasons I added the capability to 'wrap' a
script to Citrus.

After wrapping, you can always edit the wrapped script which will be in

apps/MyApp.app//Contents/Resources



Cheers

Mark












Reply all
Reply to author
Forward
0 new messages