Google Gruppi non supporta più i nuovi post o le nuove iscrizioni Usenet. I contenuti storici continuano a essere visibili.

Icon background acting as a progress bar (Windows)

74 visualizzazioni
Passa al primo messaggio da leggere

Alexandru

da leggere,
13 lug 2015, 11:50:0213/07/15
a
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

da leggere,
13 lug 2015, 11:54:2813/07/15
a
AFAIK this is supported by TWAPI.
But it might be the new menu.

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

Alexandru

da leggere,
13 lug 2015, 12:11:0713/07/15
a
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

da leggere,
13 lug 2015, 16:44:5713/07/15
a
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

da leggere,
13 lug 2015, 22:16:0013/07/15
a
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

da leggere,
14 lug 2015, 04:28:0614/07/15
a
* 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

da leggere,
14 lug 2015, 05:23:0114/07/15
a
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

da leggere,
14 lug 2015, 05:25:5814/07/15
a
> 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 nuovi messaggi