Want to re-pack() a Frame displaying a collection

C

Charles Krug

List,

I'd like to do the following with Tkinter's Frame() object:

1. Display a collection of pack()-able objects. Easy. Done. I hold
the objects in a dictionary, mostly so that the owning program can refer
to them uniformly.

2. Whenever the collection is added to or deleted from, re-pack() the
owning object.

Will this happen automatically simply whenever I add or delete from the
object's __dict__, or do I need to add to __setattr__ and __delattr__ to
detect when the user has added or removed an object?

Thanks

Not Quite Related:

I'm doing a lot of displaying of (Label, Entry) pairs so I've another
subclass of Frame() that simplifies that action for me. These are items
from a collection that's created at runtime where the labels aren't
known in advance.

Right now, I'm raising an exception if grid() or place() is called on
the object. Eventually, what I'd like to do is flesh out the grid() and
place() methods so that the Label and Entry are placed in what I think
are sensible default positions reletive to the desired placement.

With grid(), how do I determine my current column and row in the case
when grid() is invoked without arguments?

With place() . .pretty much the same song. I need to determine my
position so that I can Do The Right Thing (or at least the expected
thing).

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,591
Members
45,100
Latest member
MelodeeFaj
Top