adaptive task bar icon

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

adaptive task bar icon

Nathan Smith
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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/7e2da332-34e2-4525-ee29-0f11b083b893%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: adaptive task bar icon

Robin Dunn
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.



On Wednesday, September 4, 2019 at 5:08:06 PM UTC-7, Nathan smith wrote:
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

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/d8d789ec-d2f7-483e-a7dc-176687f32b35%40googlegroups.com.