Category talk:Plugins Tutorial: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Creating the Interface===
===Creating the Interface===
Now we need to write the callback method, ''fetchPDBDialog'', which creates the interface.
 


!
!
To avoid an error if the pdbCode returns 2None" e.g. by pressing the cancle button in dialog popup,
To avoid an error if the pdbCode returns "None" e.g. by pressing the cancel button in dialog popup,
use this changed part of program  
use this changed part of program  
!
!

Latest revision as of 11:54, 25 March 2005

Creating the Interface

! To avoid an error if the pdbCode returns "None" e.g. by pressing the cancel button in dialog popup, use this changed part of program !

 def fetchPDBDialog(app):
    pdbCode = tkSimpleDialog.askstring('PDB Loader Service',
                                       'Please enter a 4-digit pdb code:',
                                       parent=app.root)
    if pdbCode:         # to avoid an error when pdbCode returns None! (e.g. cancle button!)
      remote(pdbCode)