Is it possible to use icns icons on mac?

I’m able to use ico files on mac fine for dock icons using SetIcon on wx.TaskBarIcon, but the icons are looking pixelated and I’m guessing that’s because I should be using the native icns format for my icons (maybe not?)

I’ve created icns files but I don’t seem to be able to set them view the SetIcon method, i get

File “/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py”, line 2154, in SetIcon

return windows.TaskBarIcon_SetIcon(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “icon.Ok()” failed at /BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul

I’m using a .icns file on my Mac application and it works just fine. Maybe your icns file isn’t compatible (how did you generate it?) or there was a bug in that version of wxPython. I’m on version 2.9.3.1

···

On Monday, April 23, 2012 10:15:37 AM UTC-4, Paul wrote:

I’m able to use ico files on mac fine for dock icons using SetIcon on wx.TaskBarIcon, but the icons are looking pixelated and I’m guessing that’s because I should be using the native icns format for my icons (maybe not?)

I’ve created icns files but I don’t seem to be able to set them view the SetIcon method, i get

File “/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py”, line 2154, in SetIcon

return windows.TaskBarIcon_SetIcon(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “icon.Ok()” failed at /BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul

have you checked your ICNS file via Apple's icon composer?
Loved or hated - it is a small program which comes w/ the developer
tools and helps w/ icns files.
You can either provide ONE image of 128x128, or 4 images in
16x16,32,x32,48x48 and 128x128.
The main problem, I guess, is that Apple allows PDF files w/ vector
parts, from what i recall wx's Icon-treatment cannot handle internally
(though you can always try py2app's icon option).
My suggestion: give the icon composer a try and see whether the main
issue is the resolution of the image(s) you are feeding it with.
Usually 128x128 is more than enough ...

Cheers

···

Am 23.04.12 16:15, schrieb Paul:

I'm able to use ico files on mac fine for dock icons using SetIcon on
wx.TaskBarIcon, but the icons are looking pixelated and I'm guessing
that's because I should be using the native icns format for my icons
(maybe not?)

I've created icns files but I don't seem to be able to set them view
the SetIcon method, i get

File
"/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py",
line 2154, in SetIcon
    return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "icon.Ok()" failed at
/BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in
DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul
--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

have you checked your ICNS file via Apple's icon composer?
Loved or hated - it is a small program which comes w/ the developer
tools and helps w/ icns files.
You can either provide ONE image of 128x128, or 4 images in
16x16,32,x32,48x48 and 128x128.
The main problem, I guess, is that Apple allows PDF files w/ vector
parts, from what i recall wx's Icon-treatment cannot handle internally
(though you can always try py2app's icon option).
My suggestion: give the icon composer a try and see whether the main
issue is the resolution of the image(s) you are feeding it with.
Usually 128x128 is more than enough ...

Cheers

> I'm able to use ico files on mac fine for dock icons using SetIcon on
> wx.TaskBarIcon, but the icons are looking pixelated and I'm guessing
> that's because I should be using the native icns format for my icons
> (maybe not?)
>
> I've created icns files but I don't seem to be able to set them view
> the SetIcon method, i get
>
> File
>
"/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py",
> line 2154, in SetIcon
> return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "icon.Ok()" failed at
> /BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in
> DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon
>
> Is there a way I can get vector or non-pixelated icon for my app?
>
> Thanks!
>
> Paul
> --
> To unsubscribe, send email to
wxPython-users+unsubscribe@googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

···

On 23 April 2012 15:30, Tobias Weber <tobias.weber@roglink.net> wrote:

Am 23.04.12 16:15, schrieb Paul:

have you checked your ICNS file via Apple's icon composer?
Loved or hated - it is a small program which comes w/ the developer
tools and helps w/ icns files.
You can either provide ONE image of 128x128, or 4 images in
16x16,32,x32,48x48 and 128x128.
The main problem, I guess, is that Apple allows PDF files w/ vector
parts, from what i recall wx's Icon-treatment cannot handle internally
(though you can always try py2app's icon option).
My suggestion: give the icon composer a try and see whether the main
issue is the resolution of the image(s) you are feeding it with.
Usually 128x128 is more than enough ...

I made my icns files with icon composer, I can put them in with py2app ok.
and I guess I dont need to set icon again through wx? as it would be the
same icon. Just wondering if I'm not running from py2app how I can get it
to overlay the python icon. Maybe it is the version of wx I'm using
(2.8.12.1) that's causing the issue, I'll have a play :slight_smile:

···

On 23 April 2012 15:30, Tobias Weber <tobias.weber@roglink.net> wrote:

Cheers

Am 23.04.12 16:15, schrieb Paul:
> I'm able to use ico files on mac fine for dock icons using SetIcon on
> wx.TaskBarIcon, but the icons are looking pixelated and I'm guessing
> that's because I should be using the native icns format for my icons
> (maybe not?)
>
> I've created icns files but I don't seem to be able to set them view
> the SetIcon method, i get
>
> File
>
"/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py",
> line 2154, in SetIcon
> return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "icon.Ok()" failed at
> /BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in
> DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon
>
> Is there a way I can get vector or non-pixelated icon for my app?
>
> Thanks!
>
> Paul
> --
> To unsubscribe, send email to
wxPython-users+unsubscribe@googlegroups.com
> or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

I'm using a .icns file on my Mac application and it works just fine. Maybe
your icns file isn't compatible (how did you generate it?) or there was a
bug in that version of wxPython. I'm on version 2.9.3.1

I made them with icon composer, I'm on wx 2.8.12.1 so maybe that's this
issue?

···

On 23 April 2012 15:28, Cameron Leger <cleger@thedvigroup.com> wrote:

On Monday, April 23, 2012 10:15:37 AM UTC-4, Paul wrote:

I'm able to use ico files on mac fine for dock icons using SetIcon on
wx.TaskBarIcon, but the icons are looking pixelated and I'm guessing that's
because I should be using the native icns format for my icons (maybe not?)

I've created icns files but I don't seem to be able to set them view the
SetIcon method, i get

File "/usr/local/lib/wxPython-**unicode-2.8.12.1/lib/python2.**
7/site-packages/wx-2.8-mac-**unicode/wx/_windows.py", line 2154, in
SetIcon
    return _windows_.TaskBarIcon_SetIcon(***args, **kwargs)
wx._core.PyAssertionError: C++ assertion "icon.Ok()" failed at
/BUILD/wxPython-src-2.8.12.1/**src/common/dcgraph.cpp(144) in
DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

You mentioned using SetIcon, but in my application (which works with an .icns file) I am not using such method.

In my python file for using py2app, I’ve set the following:

OPTIONS = {‘argv_emulation’: False, ‘iconfile’: ‘/path/to/icon.icns’, ‘plist’: PLIST}

Where PLIST is another dictionary of things that shouldn’t matter for an icon. Then, in setuptools.setup() I’ve passed:

options={‘py2app’: OPTIONS}

These are the only things related to the .icns file in my application, and the icon works for me.

···

On Monday, April 23, 2012 11:40:43 AM UTC-4, Paul wrote:

On 23 April 2012 15:28, Cameron Leger cleger@thedvigroup.com wrote:

I’m using a .icns file on my Mac application and it works just fine. Maybe your icns file isn’t compatible (how did you generate it?) or there was a bug in that version of wxPython. I’m on version 2.9.3.1

I made them with icon composer, I’m on wx 2.8.12.1 so maybe that’s this issue?

On Monday, April 23, 2012 10:15:37 AM UTC-4, Paul wrote:

I’m able to use ico files on mac fine for dock icons using SetIcon on wx.TaskBarIcon, but the icons are looking pixelated and I’m guessing that’s because I should be using the native icns format for my icons (maybe not?)

I’ve created icns files but I don’t seem to be able to set them view the SetIcon method, i get

File “/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py”, line 2154, in SetIcon

return windows.TaskBarIcon_SetIcon(*args, **kwargs)

wx._core.PyAssertionError: C++ assertion “icon.Ok()” failed at /BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in DoDrawIcon(): wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

You mentioned using SetIcon, but in my application (which works with an
.icns file) I am not using such method.

Indeed -- as of a couple years ago, wx itself had no way to work with
OS_X *.icns files -- so in your wx code, you needed to use another
format, and then use py2app (or something else) to assign the *.icns
file to your app, in the OS-X way.

a bit awkward, but that's what we've got.

-Chris

···

On Fri, Apr 27, 2012 at 6:52 AM, Cameron Leger <cleger@thedvigroup.com> wrote:

In my python file for using py2app, I've set the following:

OPTIONS = {'argv_emulation': False, 'iconfile': '/path/to/icon.icns',
'plist': PLIST}

Where PLIST is another dictionary of things that shouldn't matter for an
icon. Then, in setuptools.setup() I've passed:

options={'py2app': OPTIONS}

These are the only things related to the .icns file in my application, and
the icon works for me.

On Monday, April 23, 2012 11:40:43 AM UTC-4, Paul wrote:

On 23 April 2012 15:28, Cameron Leger <cleger@thedvigroup.com> wrote:

I'm using a .icns file on my Mac application and it works just fine.
Maybe your icns file isn't compatible (how did you generate it?) or there
was a bug in that version of wxPython. I'm on version 2.9.3.1

I made them with icon composer, I'm on wx 2.8.12.1 so maybe that's this
issue?

On Monday, April 23, 2012 10:15:37 AM UTC-4, Paul wrote:

I'm able to use ico files on mac fine for dock icons using SetIcon on
wx.TaskBarIcon, but the icons are looking pixelated and I'm guessing that's
because I should be using the native icns format for my icons (maybe not?)

I've created icns files but I don't seem to be able to set them view the
SetIcon method, i get

File
"/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_windows.py",
line 2154, in SetIcon
return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "icon.Ok()" failed at
/BUILD/wxPython-src-2.8.12.1/src/common/dcgraph.cpp(144) in DoDrawIcon():
wxGCDC(cg)::DoDrawIcon - invalid icon

Is there a way I can get vector or non-pixelated icon for my app?

Thanks!

Paul

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov