[Tutor] Tkinter / Variable passing
Faulconer, Steven M.
STEVEN.M.FAULCONER at saic.com
Wed Jul 21 15:24:17 CEST 2004
Hello everyone,
Been working on a Tkinter/PMW application that acts as a graphical front end
to several command-line programs. The gist of the program is this:
User starts program, instantiates MainApp class. User selects a project and
a 'database' (a term for a flat file, binary database used by our software,
not an SQL-type database), and clicks the select button. This instantiates
the CheckerApp class that gives the user the option to run the various
command-line programs or view their reports. When the user clicks a button
to run a checker, it instantiates the CheckerWindow class that essentially
redirects the output of the command line program and displays it in a
Tkinter window. The user then clicks accept/cancel to accept the software
run or not accept.
This is where the issue lies. How can I tell the CheckerApp instance what
the user selected in the CheckerWindow instance? I've tried different types
of variables (global and non). I've even added a function to the CheckerApp
that I attempt to call from the CheckerWindow, which fails with an
"AttributeError" Toplevel instance has no attribute 'CheckerAccept'".
Anyone have any thoughts or ideas? Constructive criticism on the script
would be greatly appreciated. I'm fairly new to Python and VERY new to
Tkinter/GUI programming, so any suggestions would be wonderful. Something I
would like to do eventually is have the 'checkers' defined in a
list/dictionary, and build the GUI elements from the contents of that
list/dictionary. I just haven't gotten that far yet. Also, the program isn't
finished, and if you don't have the software we use installed, it won't work
as is.
Thanks in advance for any information you can send.
Steven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.py
Type: application/octet-stream
Size: 22100 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20040721/6721a8be/main-0001.obj
More information about the Tutor
mailing list