Beispiel #1
0
    def addMolecule(self, mol, name=None):
        if name is None:
            name = mol.name

        
        d = MoleculeDrawer(self._int,
                           mol,
                           name)
        self.c += 1
        if self.c >= self.cols:
            self.c = 0
            self.r += 1
            self._int.grid_rowconfigure(self.r, weight=1)

        d.grid(row=self.r, column=self.c, sticky="NEWS")
Beispiel #2
0
from Tkinter import *
from frowns.Depict.TkMoleculeDrawer import MoleculeDrawer
from frowns import MDL

# read in a molecule
reader = MDL.sdin(open("bad.sdf"))
mol, error, text = reader.next()

# create the moleculedock widget and place it
# into a tk window
tk = top = Tk()
m = MoleculeDrawer(top, mol, 0)
m.pack(fill=BOTH, expand=1)

mainloop()