[Tutor] some tkinter questions

Suzanne Little s349929@student.uq.edu.au
Fri, 17 Dec 1999 15:12:52 +1000 (GMT+1000)


I've been learning Python for a little over 3 weeks now and I've run into
a couple of snags. 

1. I've created a window that pops up using toplevel and I want to click
'cancel' in that window and close only that window. Specifically the code
is w1 = Toplevel()
   w1.window = createWin(w1)

2. Communication between modules/classes: I've got a main gui window
running with a listbox. In anther module I want to add/delete/access
an item from the listbox and I'm having some problems. I've got two
functions written in the main module which will get the selection and
update the list both of which work successfully but I can't call them from
the other module. I suspect that this may be because both the modules
import each other. That is main imports the sub modules and the sub
modules import main, therefore when I start the program by running main it
tries to use one of the submodules and gets to the point in it where it
tries to access a function in main and fails. What do you think?

3. Is there any easy way of getting the representation of an instance? For
example if I create a = myClass() and add a to a kjset, can I then ask
what is at some point in the set and get back a as opposed to <myClass at
instance 1209ef> or something? 

4. I've also had some problems attaching a scroll to the listbox. I can
get one showing but it will only move one position down. Any suggestions?

5. Can I implement drop down menus in tkinter?

Thanks very much for any help anyone can provide. Just add that I'm
finding Python a really nice language to work with.


"Contrariwise," continued Tweedledee, "If it was so, it might be; and if
it were so, it would be; but as it isn't, it ain't.  That's logic"
                             -Lewis Carroll