On Fri, 21 Jul 2006 15:01:30 -0400
Orri Ganel <[EMAIL PROTECTED]> wrote:

> As a follow up to my last email, I think the issue is more that the 
> display doesn't update before the command associated with the "search" 
> button has finished processing, so any attempts to get data about the 
> display from within the method are fruitless since the display hasn't 
> changed yet.  I am well and truly stumped.  I have no idea how to get 
> around this.  

Calling update_idletasks() from within this method before quering diplay data
should do the trick.

The only way I can think of to do this without using the 
> display is figuring out the longest track name length and setting the 
> CheckList width to the pixel version of that.  Unfortunately, I don't 
> know the conversion for character units to pixels, either, so I'm still 
> stuck.
> 

I think the tkFont module has what you need:

>>> from Tkinter import *
>>> l=Label(text='hi')
>>> l.pack()
>>> import tkFont
>>> f=tkFont.Font(family='helvetica', size='-14')
>>> l.config(font=f)
>>> print f.measure(l['text'])
11
>>> print f.measure('blahblah')
54

I hope this helps

Michael

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to