[Tkinter-discuss] Lots of widgets in a Text widget

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Thu Jul 17 09:17:05 CEST 2008


I had a similar problem, with my application with Text and Canvas. After 
some testing I realized that enormous amount of time was used by Tk/Tcl 
from the tag_bind routine. In the end I've decided to use a global 
binding for the mouse and cache the bounding box of each element. It is 
a bit more messier to handle because for each modification you have to 
take care on the position of the bounding boxes, but in the end is much 
faster than using the tag_bind

Cheers
Vasilis

Bob Greschke wrote:
> Personally, I don't think it does any good to see any of them. The 
> users will just get in there and mess things up! Haha.
>
> I could have a different form where they enter the ID number of an 
> instrument and just work with that unit. There's really no logical way 
> to split them up other than like 100 at a time or something like that. 
> Which one the user wants to change info for is usually just random so 
> showing them all is best.  Changing things manually is only really 
> done if one stops working and you need to set the broken flag or fill 
> in that last field with a designation for the deployed location.
>
> We should be updating to 8.5 next week so I'll try it out.
>
> Thanks!
>
> Bob
>
> --------
> Sent from my iPod
>
> On Jul 16, 2008, at 18:19, "Guilherme Polo" <ggpolo at gmail.com> wrote:
>
>> On Wed, Jul 16, 2008 at 7:17 PM, Bob Greschke <bob at passcal.nmt.edu> 
>> wrote:
>>> I have a program that maintains a simple, on-the-fly database using a
>>> dictionary.  The user can see what is going on with it by brining up a
>>> toplevel with a Text() widget.  Checkbuttons and Entry fields are 
>>> used to
>>> display the state of the items in the database (see picture).
>>>
>>> www.passcal.nmt.edu/~bob/unlinked/images/showdb.tiff
>>>
>>> The EN, AE, BR, etc. "flags" are the Checkbuttons and to the right 
>>> of each
>>> TP, TO and ST label is an Entry field.  Each line is one seismic 
>>> recording
>>> instrument which this program talks to.  From this 'form' the user can
>>> manually make changes to the state of each instrument by just 
>>> clicking the
>>> flags or entering stuff in the fields.  The problem is when there are
>>> hundreds of instruments it starts to take a long time to open the 
>>> form and
>>> fill it all in, scroll the form, and close the form and destroy all 
>>> of those
>>> widgets.  Is there a faster way?
>>
>> What if you limit the amount of instruments shown at a time ? Does it
>> bring any advantage to show them all ?
>>
>> Also, you could try running that app under tk 8.5, it will require no
>> changes and it is said to be 10% faster but I have never tested it so
>> maybe you can test this.
>>
>>> Would putting all of this on a Canvas be
>>> faster?  I'd try it, but it would take a bit of messing just to do the
>>> experiment -- only to find out it's not faster, plus I'm not looking 
>>> forward
>>> to counting pixels to get everything to line up.  This late-summer 
>>> we will
>>> have an experiment with a few thousand instruments, so I'm lookin' 
>>> for a
>>> solution. :)
>>>
>>> Thanks!
>>>
>>> Bob
>>> _______________________________________________
>>> Tkinter-discuss mailing list
>>> Tkinter-discuss at python.org
>>> http://mail.python.org/mailman/listinfo/tkinter-discuss
>>>
>>
>>
>>
>> -- 
>> -- Guilherme H. Polo Goncalves
>>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Vasilis_Vlachoudis.vcf
Type: text/x-vcard
Size: 312 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20080717/9cb232f1/attachment.vcf>


More information about the Tkinter-discuss mailing list