<div class="gmail_quote">On Sun, Sep 9, 2012 at 12:12 PM, Peter Otten <span dir="ltr"><<a href="mailto:__peter__@web.de" target="_blank">__peter__@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

the above will no longer complain about a missing attribute.<br>
<br>
> root = Tk()<br>
> project = ch8_Project(master=root)<br>
> project.mainloop()<br>
<br>
<br>
Another problem that caught my attention:<br>
<br>
>     self.green = Button(root, text="Green",<br>
command=self.change_text_color("green"))<br>
<br>
<br>
The command argument is supposed to be a function; you are instead assigning<br>
the result of a method call (which is None in this case, but as a side<br>
effect will set the color to green immediately. The simplest fix is to<br>
define a helper function that takes no arguments<br>
     ...<br>
     def change_to_green():<br>
         self.change_text_color("green")<br>
     self.green = Button(root, text="Green", command=change_to_green)<br>
     ...<br>
<br>
If you already know about lambda you can try to rewrite this using that.<br>
<br></blockquote></div><br>Peter, thank you for helping me understand the scope issue I was missing! I knew it was something like that but forget that omitting "this." meant the variables were limited in scope to that method. <br>
<br>I have seen lamba but do not understand it. The project requires four buttons, each one turns the same text a different color. The class is also Python 3 based.  :)<br><br>Leam<br><br><br clear="all"><br>-- <br><div><a href="http://leamhall.blogspot.com/" target="_blank">Mind on a Mission</a></div>
<br>