Table of Contents

Module: base ModelPanel/base.py

Imported modules   
import Pmw
import Tix
import Tkinter
import chimera
from chimera import help, openModels
from chimera.baseDialog import ModelessDialog
import os
Functions   
activateAllCmd
addButton
addColumns
attributesCmd
backboneCmd
focusCmd
getPhysicalChains
inputPath
readableName
selectCmd
seqCmd
setModelField
setModelFieldOnly
showAllAtomsCmd
surfCmd
tileCmd
toggleModelField
  activateAllCmd 
activateAllCmd ()

Activate all models. Restore previous activities if called again.

  addButton 
addButton (
        name,
        callback,
        minModels=1,
        maxModels=None,
        moleculesOnly=1,
        balloon=None,
        defaultFrequent=1,
        )

Add a button to the Model Actions button list.

name is the button name (duh). callback is the function to call when the button is pressed. The arg to callback will be a list of models. min/maxModels indicate how many models have to be selected in the browser for the button to be active (None indicates no limit). if moleculesOnly is 1, then those models have to be Molecules.

This is a module function so that it can be called even if the model panel has not yet been created.

Exceptions   
KeyError, "Button named '%s' already exists" % name
  addColumns 
addColumns ( columnInfo,  defaultShown=1 )

Add columns to the model table.

columnInfo is a list of 3-tuples, one for each column to add. The tuple consists of (column name, value type, value-fetch function). The value type should be text, image, imagetext, or toggle. The value-fetch function takes one argument (a model) and (for image and text) should return the value to display in the table cell. For imagetext the return value should be an (image, text) tuple. toggle shows a toggle button and the return value should be a (boolean, callback) tuple. If the boolean is true, a check will be shown on the toggle button; otherwise the button is blank. The callback is invoked when the toggle is pressed, with the model and the new boolean as arguments. The value of an image is the name of the image (the Tix name, e.g. tick for tickmark). A value of None for image or text will leave a blank cell.

defaultShown controls whether the column is shown in the model table or not as long as the user has not yet expressed a preference in the Configuration panel about it.

Exceptions   
ValueError, "Duplicate model panel" "column name: %s" % name
  attributesCmd 
attributesCmd ( models )

  backboneCmd 
backboneCmd ( models,  resTrace=1 )

  focusCmd 
focusCmd ( models )

  getPhysicalChains 
getPhysicalChains ( model )

  inputPath 
inputPath ( model )

  readableName 
readableName ( model )

  selectCmd 
selectCmd ( models )

  seqCmd 
seqCmd ( models )

  setModelField 
setModelField (
        models,
        field,
        value,
        openState=0,
        )

functions used in model panel button; could be called directly also

  setModelFieldOnly 
setModelFieldOnly (
        models,
        field,
        onVal=1,
        offVal=0,
        openState=0,
        )

  showAllAtomsCmd 
showAllAtomsCmd ( models )

  surfCmd 
surfCmd ( models,  category )

  tileCmd 
tileCmd ( models )

  toggleModelField 
toggleModelField (
        models,
        field,
        onVal=1,
        offVal=0,
        openState=0,
        )

Classes   
ModelPanel

Table of Contents

This document was automatically generated on Tue Nov 5 16:56:31 2002 by HappyDoc version 2.0.1