[wxPython-users] Making ProgressDialog adapt its size to the message

Werner F. Bruhin werner.bruhin at free.fr
Fri Jun 15 03:05:12 PDT 2007


Grzegorz Adam Hankiewicz wrote:
> Robin Dunn wrote:
>> Grzegorz Adam Hankiewicz wrote:
>>> On top of that, the call to Fit() seems to mess up the space around 
>>> the time estimation texts. What can I do to make it look ok?
>>
>> In what way is it messed up?
>
> Attached screenshots. I made the process call Fit() only after a few 
> files so I could capture the differences. The bad one shows the time 
> texts moving too far to the left, and Fit() doesn't seem to take into 
> account the size of the filename, which ends in .jpg but is cut and 
> only .jp is seen.
>
> It seems that the main idea for the dialog size is to take the 
> progress bar and add about 10/15 pixels left right for spacing. Well, 
> the texts don't respect that spacing, something is broken with them. 
> This is with 2.8.4.0 MSW.
>
> My expectations for the width of the dialog would be:
>
>   min(progress_bar_min_size, max([text_length1, text_length2, ...]))
>     + border left + border right.
>
> Right know it looks like:
>
>   border left + border right + progress_bar_min_size
>
> The progress bar in the demo looks much better, I wonder if that is 
> because the cancel button is made visible.
I have seen this too in earlier releases (also on MSW).  I just cheat by 
using a long text when initializing the dialog, not ideal but it does 
the trick.

Werner




More information about the wxpython-users mailing list