[Tkinter-discuss] Tkinter Class / Data passing

Faulconer, Steven M. STEVEN.M.FAULCONER at saic.com
Mon Jul 19 16:17:44 CEST 2004

Hello everyone,
I have a program I've written that essentially acts as a graphical front-end
to several in-house written command-line programs. The script is using
Tkinter/Pmw as the interface language. The software works like this:

A user runs the script and is presented with an interface where they select
a 'project' and a 'database'. The user clicks a button to accept those
selections, which starts a new window. In this window is a number of Pmw
group widgets containing a set of widgets for each command-line program (we
call them 'checkers'). Each checker widget group has a button to run the
checker software (command-line). This is redirected to a NEW Toplevel

My question is, what is the best method for getting data out of this new
Toplevel window? Meaning, this new Toplevel window has a set of buttons that
allow the user to accept the software run, based on the output, or cancel
the run (not accepting the run). The issue is, how do I tell the parent the
outcome? I've tried creating a variable in the parent and setting it in
various places in the child, but that doesn't seem to work. The value never
changes. I've even tried using a global variable, but that still doesn't
I debated attaching the code, but I think it will help with my issue.
MainApp is the primary window that runs first. It starts a new CheckerApp
window, which lists all the checkers, and starts a CheckerWindow when the
user actually clicks the 'run checker' button in the checkerapp. How can I
tell the CheckerApp, from within CheckerWindow, what button the user
selected (accept/deny). 

I'm sure its obvious by my code, but I'm a new programmer, and the script is
still unfinished. Constructive criticism is greatly appreciated. And please
let me know if I did not explain the issue well enough. Thanks.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.py
Type: application/octet-stream
Size: 22188 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20040719/243d59b5/main.obj

More information about the Tkinter-discuss mailing list