Ian Ward | 18 Sep 2006 15:53
Favicon
Gravatar

Re: Patch: Text.pack() fails with multi-line strings

Graham Clinch wrote:
> Hi List,
> 
> I'm having some problems using a Text instance's pack method to get the 
> screen columns a multi-line string will display as.  I've stuck a short 
> example that demonstrates this problem for me at the end of the email.
> 
> It looks as though there's an off-by-one error in the special-case 
> handling of '\n' in strings, and I believe the fix is to apply the 
> following patch:

Yes, your patch looks correct. Thanks!

I only recently added pack() with the intent of creating a menu bar and 
drop-down widget, but I haven't done much testing yet.  There may be 
more bugs lurking in that code  :-)

I'm wrestling with the more general question of how to design an 
interface for asking widgets "how big would you like to be?"  I hope I 
got it right, but if not the pack() function might change slightly in 
future versions.

Ian

Gmane