[Tkinter-discuss] Tkinter Class / Data passing

Faulconer, Steven M. STEVEN.M.FAULCONER at saic.com
Fri Jul 23 19:26:55 CEST 2004

The question actually got answered on the tutor list. Please accept my
apologies for not updating this list. Thank you for the concern. The end
result was the error I received is correct. What I eventually did was pass
the instance of my parent class (self) in addition to the parent root
instance. This allowed me to make a function calls on my parent class
instance. I'll post my final code for comments when it is completed.

Thanks for the concern.


-----Original Message-----
From: Cameron Laird [mailto:Cameron at Phaseit.net] 
Sent: Friday, July 23, 2004 12:56 PM
To: Faulconer, Steven M.
Cc: 'tkinter-discuss at python.org'
Subject: Re: [Tkinter-discuss] Tkinter Class / Data passing

On Mon, Jul 19, 2004 at 07:17:44AM -0700, Faulconer, Steven M. wrote:
> I have a program I've written that essentially acts as a graphical
> 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
> 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
> call them 'checkers'). Each checker widget group has a button to run the
> checker software (command-line). This is redirected to a NEW Toplevel
> window. 
> 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
> 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
> 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
> changes. I've even tried using a global variable, but that still doesn't
> work.
> 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
> still unfinished. Constructive criticism is greatly appreciated. And
> let me know if I did not explain the issue well enough. Thanks.
Has no one answered Mr. Faulconer's question?  My impression is
that it's MUCH easier than he's making it, but I'm not in a po-
sition to address it any time soon.  I sure don't want him
thinking that we're unresponsive or that Tkinter is difficult,
both of which I know to be false, with occasional exceptions.
'Anyone comfortable with PMW have time for this?

More information about the Tkinter-discuss mailing list