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

progressbar with text

815 views
Skip to first unread message

rene

unread,
Sep 25, 2013, 1:52:42 PM9/25/13
to
Hi,

I'm using the ttk::progressbar.

Now I would like to put some text
inside the progressbar. So far
I have no solution except making
a progressbar based on the canvas.

Is there a way to do this inside ttk?


Thanks,
rene

tombert

unread,
Sep 30, 2013, 2:13:06 AM9/30/13
to
I think you could try "place" instead of "pack" which allows you to put widgets on top of others ...

Donal K. Fellows

unread,
Sep 30, 2013, 11:20:15 AM9/30/13
to
On 30/09/2013 07:13, tombert wrote:
> I think you could try "place" instead of "pack" which allows you to
> put widgets on top of others ...

The [grid] can be told (explicitly) to put widgets on top of each other.

However, to get good text inside a progress bar, you do need to use
[place]. And to be open to being quite careful. I wrote it up long ago
in quite a bit more detail than I now remember:

http://www.cs.man.ac.uk/~fellowsd/tcl/mwidx.html#progress

Also, I'm not at all convinced that it is going to be practical to make
text-on-progress-bar work on all platforms. It's not how progress bars
tend to look these days. (I don't know if it is possible to add extra
elements to a Ttk widget, or whether you're stuck with what you start
out with; as the standard looks don't have text, doing it the Ttk way
would require adding a label element. I think.)

Donal.
--
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.

rene

unread,
Sep 30, 2013, 11:47:25 AM9/30/13
to
Am Montag, 30. September 2013 17:20:15 UTC+2 schrieb Donal K. Fellows:
> On 30/09/2013 07:13, tombert wrote:
>
> > I think you could try "place" instead of "pack" which allows you to
>
> > put widgets on top of others ...
>
Yes, I'm aware of the different possibilities to put one
widget over the other. The remaining problem is the background.

The ttk::progressbar use the background system dependent.
Is there a way to use the same background with an label
or even better use a transparent label?


Thank you
rene

tombert

unread,
Oct 1, 2013, 4:47:44 PM10/1/13
to
With ttk you cannot set a background for each widget individually, at least not so easy because it depends on the Theme you are using. It is best to use the "normal" tk label.
There is no transparent background - you need to set it to the same colour as the progress bar.

rene

unread,
Oct 9, 2013, 1:23:05 PM10/9/13
to
Am Dienstag, 1. Oktober 2013 22:47:44 UTC+2 schrieb tombert:
> With ttk you cannot set a background for each widget individually, at least not so easy because it depends on the Theme you are using. It is best to use the "normal" tk label.
>
> There is no transparent background - you need to set it to the same colour as the progress bar.
For the record. I found a better solution.
Create a ttk::progressbar and a label widget inside a frame
with grid using the same row and column.
Configgure the label with -compound center.
Raise the progressbar, create a image of it using rbc::winop.
Then put the image in the label and raise the label.
The only problem so far is the not working <Expose> event under windows.

rene

0 new messages