adaptive task bar icon

917 views
Skip to first unread message

Nathan smith

unread,
Sep 4, 2019, 8:08:06 PM9/4/19
to wxpytho...@googlegroups.com
hi there,

I'm writing a program that includes a clock.

I'd like to make it to where the task bar icon is either a tiny digital
clock with the time inside it, that updates, or just a little, readable
box with the time inside it.

To that end, first, is there a way in wx python to make an icon for the
task bar icon which is just, for example, a white background with black
text on it?

And secondly, if  I want to update the task bar icon, would it be:

self.taskbaricon.RemoveIcon()

then self.taskbaricon.setIcon(newicon, newtooltip)

Is that very resource intensive? As it is being done every second for a
clock, I'm hoping not.

Thanks a lot.

Nathan

Robin Dunn

unread,
Sep 5, 2019, 7:09:00 PM9/5/19
to wxPython-users
1. You can use a wx.MemoryDC to draw whatever you want onto a wx.Bitmap, and then the bitmap can be converted to a wx.Icon.

2. You can change icons by just calling SetIcon again, and that should not be resource intensive at all.  RemoveIcon only needs to be called when you do not want to have any icon in the taskbar anymore.
Reply all
Reply to author
Forward
0 new messages