[Tutor] Class mind boggle

Chad Crabtree flaxeater at yahoo.com
Fri Nov 5 19:07:01 CET 2004


Liam Clarke wrote:

>Hello all, 
>
>
>
>I have a little prog I'm writing, and I'm creating a GUI with
PythonCard.
>
>The actual functions accessed by the GUI are in a separate module.
>
>
>
>Now, I would like to call a dialog box if needed in one of the
>
>separate functions, if a password is wrong, get it via a nice little
>
>pop-up.
>  
>
Ok here's an example from one of my projects.

        results=dialog.colorDialog(self)
        if results.accepted:
            if DEBUG: print 'Accepted'
            self.displayColorValues(results.color)
            self.setMemory(results.color)

I hope this helps.  I don't think it's quite as bad as you think. 


def getPassword(self):
    get the password
    if password==isgood:
       then do stuff:
    else:
       self.results=dialog.textEntryDialog(self, 'Enter Password,

now the self in this psuedo code means you can access this
information 
outside of the function.
      

'Uhoh' , 'Python')




		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 



More information about the Tutor mailing list