Re: How to add a badge to an icon?
[email protected] Fri, 03 Jan 2025 08:26:47 -0600
| Newsgroups | gmane.comp.lib.fox-toolkit.user |
|---|---|
| Message-ID | <[email protected]> |
On 2025-01-03 07:38, Roland Hughes via Foxgui-users wrote: > Traditionally you use a graphics tool, create 2 different icons, then > use the appropriate icon. This is irregardless (never should have > banned that word!) of the graphics library you are using. > > The left-handed-you-must-have-been-drunk-on-a-Tuesday method is create > two icons of the exact same size and place them in the exact same > position. One icon will be at least 50% transparent so when placed on > top you can still see some of the other below. Since FXIcon is derived from FXImage, you can make it the destination of drawing operations [after create() generates its off-screen X11-server resident buffer]. So, make a mini-image of your badge, then draw it onto the base icon, then draw the icon to the screen repeatedly. The difference between FXIcon and FXImage is, however, that the FXIcon also has two additional 1-bit buffers for the mask and "etch" mask. You may need to find some way to update those as well [I have no super-easy solution for it, maybe restore() local buffer from updated server-side buffer, and regenerating the masks, is the best idea for now. -- JVZ