Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Icon background acting as a progress bar (Windows)

74 views
Skip to first unread message

Alexandru

unread,
Jul 13, 2015, 11:50:02 AM7/13/15
to
Hi,

Tk already supports progress bars, but I would also like to show the progress bar as the background of the icon of my Tcl/Tk application in the task bar.

An example for this is FireFox or IE, when a download is in progress. One can minimize the window, work in another window an still see how the download progresses.

Here is an example: http://www.codeproject.com/KB/winsdk/Win7NewFeatures/ProgressBar2.png

Is it possible to do the same thing with Tcl/Tk under Windows?

Many thanks!
Alexandru

Harald Oehlmann

unread,
Jul 13, 2015, 11:54:28 AM7/13/15
to
AFAIK this is supported by TWAPI.
But it might be the new menu.

Well, shouldn't write anything, don't know exactly.
Harald

Alexandru

unread,
Jul 13, 2015, 12:11:07 PM7/13/15
to
Am Montag, 13. Juli 2015 17:54:28 UTC+2 schrieb Harald Oehlmann:
> AFAIK this is supported by TWAPI.
> But it might be the new menu.

I also thought about that... Google didn't find anything for "twapi progress". I also searched the Twapi documentation but didn' find a thing. I guess, if this is possible, then it is not straight forward.

If anybody point me to the right direction, that would be great!

Mike Griffiths

unread,
Jul 13, 2015, 4:44:57 PM7/13/15
to
I've looked into this before without any luck. I don't think there's currently anything available for it, and after spending a couple of hours poking through Win32 APIs and whatnot I found it a bit beyond my ability to implement myself. Would be really nice to see this, and the other related functionality, available to Tk, though.

pal...@yahoo.com

unread,
Jul 13, 2015, 10:16:00 PM7/13/15
to
TWAPI does not have any support for these API's. It's a fair amount of work afaict and needs a combination of COM and handling of Windows messages. Unfortunately, the COM interfaces are not IDispatch based so can't be scripted from twapi. Additionally, handling the Windows messages would I suspect require some way for extensions to hook into Tk.

/Ashok

Ralf Fassel

unread,
Jul 14, 2015, 4:28:06 AM7/14/15
to
* Alexandru <alexandr...@meshparts.de>
| I also thought about that... Google didn't find anything for "twapi
| progress". I also searched the Twapi documentation but didn' find a
| thing. I guess, if this is possible, then it is not straight forward.
>
| If anybody point me to the right direction, that would be great!

BFI:
- create a Tk image with the desired look
- use Tklib ico package or Img package (?) to write an icon file
- set the icon file via "wm iconbitmap"

I haven't tried this myself with .ico, but using simple bitmaps I could
'animate' the icon (B/W only though):

- copy two .xbm files to bm1 and bm2

proc toggle_bitmap {which} {
if {$which} {
wm iconbitmap {.} @bm1
} else {
wm iconbitmap {.} @bm2
}
after 1000 toggle_bitmap [expr {!$which}]
}
toggle_bitmap 1

R'

Alexandru

unread,
Jul 14, 2015, 5:23:01 AM7/14/15
to
Am Dienstag, 14. Juli 2015 04:16:00 UTC+2 schrieb pal...@yahoo.com:
> TWAPI does not have any support for these API's. It's a fair amount of work afaict and needs a combination of COM and handling of Windows messages.

Thanks Ashok for replying. It's a little disappointing to know, that Tk or Twapi does not support this modern feature. Perhaps some time in the future?

Alexandru

unread,
Jul 14, 2015, 5:25:58 AM7/14/15
to
> BFI:
> - create a Tk image with the desired look
> - use Tklib ico package or Img package (?) to write an icon file
> - set the icon file via "wm iconbitmap"

Hi Ralf,

thanks for the suggestion. It's a good idea but I'm afraid it wont look like a progress bar.

I you look at the example link I posted, the icon is quadratic and the text is placed to the right of the icon. The progress bar must extend over the whole length, not only over the icon but also over the text.
0 new messages