Where is wx.TaskBarIcon?

81 views
Skip to first unread message

Ram Rachum

unread,
Jun 15, 2015, 4:22:06 PM6/15/15
to wxpytho...@googlegroups.com
Hi guys,

I'm back to developing in wxPython after a long hiatus :)

Very excited about Phoenix being available. I installed it on my Python 3.4 and it was able to run a simple wxPython program. Woohoo!

Now I'm trying to convert one of my programs to Python 3.4 and Phoenix. I ran into the following problem: I get an AttributeError when trying to use `wx.TaskBarIcon`. It looks like `TaskBarIcon` isn't even defined in `wx`.

Could this be? Is this just a part that isn't ready yet? Or maybe it was renamed or moved? Please advise. 


Thanks,
Ram.

Boštjan Mejak

unread,
Jun 15, 2015, 4:36:05 PM6/15/15
to wxPython Help
After the usual  import wx  you must also  import wx.adv  and then instead of calling  wx.TaskBarIcon  you must call  wx.adv.TaskBarIcon  and you're golden. ;)

Ram Rachum

unread,
Jun 15, 2015, 4:39:02 PM6/15/15
to wxPython-users
Cool, works!

Now another thing I can't find: wx.IconFromBitmap

Any idea where it is? 


Thanks,
Ram.

On Mon, Jun 15, 2015 at 11:36 PM, Boštjan Mejak <bostjan...@gmail.com> wrote:
After the usual  import wx  you must also  import wx.adv  and then instead of calling  wx.TaskBarIcon  you must call  wx.adv.TaskBarIcon  and you're golden. ;)

--
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/OraIbkRMMEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Driscoll

unread,
Jun 15, 2015, 5:54:07 PM6/15/15
to wxpytho...@googlegroups.com


On Monday, June 15, 2015 at 3:39:02 PM UTC-5, Ram Rachum wrote:
Cool, works!

Now another thing I can't find: wx.IconFromBitmap

Any idea where it is? 


Thanks,
Ram.


Looking at Google, I found this: http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html

It appears to reside in Icon now. You might also wan to take a look at the following: http://wxpython.org/Phoenix/docs/html/MigrationGuide.html

Hope that helps!
Mike

Ram Rachum

unread,
Jun 16, 2015, 3:19:24 AM6/16/15
to wxPython-users
I've tried replacing IconFromBitmap with Icon as advised, so my code looks like this: 

        self.SetIcon(
            wx.Icon(
                wx_tools.bitmap_tools.bitmap_from_pkg_resources(
                    resources_package, 
                    'cute_mouse_grid.png'
                ),
            ), 
            'CuteMouseGrid'
        )


(The `bitmap_from_pkg_resources` function creates a bitmap.)

But then I get an error dialog saying: "iCCP: known incorrect sRGB profile".

Any idea how to solve this? 


Thanks,
Ram.


--

Werner

unread,
Jun 16, 2015, 5:04:04 AM6/16/15
to wxpytho...@googlegroups.com
On 6/15/2015 22:38, Ram Rachum wrote:
> Cool, works!
>
> Now another thing I can't find: wx.IconFromBitmap
See the constructors in wx.Icon:
http://wxpython.org/Phoenix/docs/html/Icon.html#Icon

wx.Icon(bmp) should probably do it or
wx.Icon(nameOfBmp, type=wx.BITMAP_TYPE_ANY)

there is also wx.Icon.CopyFromBitmap

See:
http://wxpython.org/Phoenix/docs/html/classic_vs_phoenix.html
http://wxpython.org/Phoenix/docs/html/Icon.html#Icon

Werner

Werner

unread,
Jun 16, 2015, 5:07:13 AM6/16/15
to wxpytho...@googlegroups.com
On 6/16/2015 9:19, Ram Rachum wrote:
I've tried replacing IconFromBitmap with Icon as advised, so my code looks like this: 

        self.SetIcon(
            wx.Icon(
                wx_tools.bitmap_tools.bitmap_from_pkg_resources(
                    resources_package, 
                    'cute_mouse_grid.png'
                ),
            ), 
            'CuteMouseGrid'
        )


(The `bitmap_from_pkg_resources` function creates a bitmap.)

But then I get an error dialog saying: "iCCP: known incorrect sRGB profile".

Any idea how to solve this?

Ram Rachum

unread,
Jun 16, 2015, 5:15:35 AM6/16/15
to wxPython-users
That worked, thank you! 

--
Reply all
Reply to author
Forward
0 new messages