This is a read-only mirror of pymolwiki.org

Category talk:Plugins Tutorial

From PyMOL Wiki
Revision as of 09:05, 25 March 2005 by JasonJPilot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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, 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)