コード例 #1
0
ファイル: modify.py プロジェクト: essil1/ase-laser
    def __init__(self, gui):
        self.gui = gui
        selected = self.selection()
        if not selected.any():
            ui.error(_('No atoms selected!'))
            return

        win = ui.Window(_('Modify'))
        element = Element(callback=self.set_element)
        win.add(element)
        win.add(
            ui.Button(_('Change element'), partial(self.set_element, element)))
        self.tag = ui.SpinBox(0, -1000, 1000, 1, self.set_tag)
        win.add([_('Tag'), self.tag])
        self.magmom = ui.SpinBox(0.0, -10, 10, 0.1, self.set_magmom)
        win.add([_('Moment'), self.magmom])

        atoms = self.gui.atoms
        Z = atoms.numbers
        if Z.ptp() == 0:
            element.Z = Z[0]

        tags = atoms.get_tags()[selected]
        if tags.ptp() == 0:
            self.tag.value = tags[0]

        magmoms = get_magmoms(atoms)[selected]
        if magmoms.round(2).ptp() == 0.0:
            self.magmom.value = round(magmoms[0], 2)
コード例 #2
0
ファイル: celleditor.py プロジェクト: arosen93/rASE
    def __init__(self, gui):
        self.gui = gui
        self.gui.register_vulnerable(self)

        # Create grid control for cells
        # xx xy xz ||x|| pbc
        # yx yy yz ||y|| pbc
        # zx zy zz ||z|| pbc
        self.cell_grid = []
        self.pbc = []
        self.angles = []

        atoms = self.gui.atoms

        cell = atoms.cell
        mags = cell.lengths()
        angles = cell.angles()
        pbc = atoms.pbc

        for i in [0, 1, 2]: # x_ y_ z_
            row = []
            for j in [0, 1, 2]: # _x _y _z
                row.append(ui.SpinBox(cell[i][j], -30, 30, 0.1,
                           self.apply_vectors, rounding=7, width=9))
            row.append(ui.SpinBox(mags[i], -30, 30, 0.1, self.apply_magnitudes,
                                  rounding=7, width=9))
            self.cell_grid.append(row)
            self.pbc.append(ui.CheckButton('', bool(pbc[i]), self.apply_pbc))
            self.angles.append(ui.SpinBox(angles[i], -360, 360, 15,
                                          self.apply_angles,
                                          rounding=7, width=9))

        self.scale_atoms = ui.CheckButton('', False)
        self.vacuum = ui.SpinBox(5, 0, 15, 0.1, self.apply_vacuum)

        # TRANSLATORS: This is a title of a window.
        win = self.win = ui.Window(_('Cell Editor'))

        x, y, z = self.cell_grid

        win.add([_('A:'), x[0], x[1], x[2], _('||A||:'), x[3],
                 _('periodic:'), self.pbc[0]])
        win.add([_('B:'), y[0], y[1], y[2], _('||B||:'), y[3],
                 _('periodic:'), self.pbc[1]])
        win.add([_('C:'), z[0], z[1], z[2], _('||C||:'), z[3],
                 _('periodic:'), self.pbc[2]])
        win.add([_('∠BC:'), self.angles[0], _('∠AC:'), self.angles[1],
                 _('∠AB:'), self.angles[2]])
        win.add([_('Scale atoms with cell:'), self.scale_atoms])
        win.add([ui.Button(_('Apply Vectors'), self.apply_vectors),
                 ui.Button(_('Apply Magnitudes'), self.apply_magnitudes),
                 ui.Button(_('Apply Angles'), self.apply_angles)])
        win.add([_('Pressing 〈Enter〉 as you enter values will '
                    'automatically apply correctly')])
        # TRANSLATORS: verb
        win.add([ui.Button(_('Center'), self.apply_center),
                 ui.Button(_('Wrap'), self.apply_wrap),
                 _('Vacuum:'), self.vacuum,
                 ui.Button(_('Apply Vacuum'), self.apply_vacuum)])
コード例 #3
0
ファイル: render.py プロジェクト: rashidrafeek/ase
    def __init__(self, gui):
        self.gui = gui
        self.win = win = ui.Window(_('Render current view in povray ... '))
        win.add(ui.Label(_("Rendering %d atoms.") % len(self.gui.atoms)))

        guiwidth, guiheight = self.get_guisize()
        self.width_widget = ui.SpinBox(guiwidth, start=1, end=9999, step=1)
        self.height_widget = ui.SpinBox(guiheight, start=1, end=9999, step=1)
        win.add([ui.Label(_('Size')), self.width_widget,
                 ui.Label('⨯'), self.height_widget])

        self.linewidth_widget = ui.SpinBox(0.07, start=0.01, end=9.99,
                                           step=0.01)
        win.add([ui.Label(_('Line width')), self.linewidth_widget,
                 ui.Label(_('Ångström'))])

        self.constraints_widget = ui.CheckButton(_("Render constraints"))
        self.cell_widget = ui.CheckButton(_("Render unit cell"), value=True)
        win.add([self.cell_widget, self.constraints_widget])

        formula = gui.atoms.get_chemical_formula(mode='hill')
        self.basename_widget = ui.Entry(width=30, value=formula,
                                        callback=self.update_outputname)
        win.add([ui.Label(_('Output basename: ')), self.basename_widget])
        self.povray_executable = ui.Entry(width=30,value='povray')
        win.add([ui.Label(_('POVRAY executable')), self.povray_executable])
        self.outputname_widget = ui.Label()
        win.add([ui.Label(_('Output filename: ')), self.outputname_widget])
        self.update_outputname()

        self.texture_widget = ui.ComboBox(labels=self.texture_list,
                                          values=self.texture_list)
        win.add([ui.Label(_('Atomic texture set:')),
                 self.texture_widget])
        # complicated texture stuff

        self.camera_widget = ui.ComboBox(labels=self.cameras,
                                         values=self.cameras)
        self.camera_distance_widget = ui.SpinBox(50.0, -99.0, 99.0, 1.0)
        win.add([ui.Label(_('Camera type: ')), self.camera_widget])
        win.add([ui.Label(_('Camera distance')), self.camera_distance_widget])

        # render current frame/all frames
        self.frames_widget = ui.RadioButtons([_('Render current frame'),
                                              _('Render all frames')])
        win.add(self.frames_widget)
        if len(gui.images) == 1:
            self.frames_widget.buttons[1].widget.configure(state='disabled')

        self.run_povray_widget = ui.CheckButton(_('Run povray'), True)
        self.keep_files_widget = ui.CheckButton(_('Keep povray files'), False)
        self.show_output_widget = ui.CheckButton(_('Show output window'), True)
        self.transparent = ui.CheckButton(_("Transparent background"), True)
        win.add(self.transparent)
        win.add([self.run_povray_widget, self.keep_files_widget,
                 self.show_output_widget])
        win.add(ui.Button(_('Render'), self.ok))
コード例 #4
0
ファイル: colors.py プロジェクト: songsiwei/ase
    def toggle(self, value):
        self.gui.colormode = value
        if value == 'jmol' or value == 'neighbors':
            if hasattr(self, 'mnmx'):
                "delete the min max fields by creating a new window"
                del self.mnmx
                del self.cmaps
                self.win.close()
                self.reset(self.gui)
            text = ''
        else:
            scalars = np.ma.array([self.gui.get_color_scalars(i)
                                   for i in range(len(self.gui.images))])
            mn = np.min(scalars)
            mx = np.max(scalars)
            self.gui.colormode_data = None, mn, mx

            cmaps = ['default', 'old']
            try:
                import pylab as plt
                cmaps += [m for m in plt.cm.datad if not m.endswith("_r")]
            except ImportError:
                pass
            self.cmaps = [_('cmap:'),
                          ui.ComboBox(cmaps, cmaps, self.update_colormap),
                          _('N:'),
                          ui.SpinBox(26, 0, 100, 1, self.update_colormap)]
            self.update_colormap('default')

            try:
                unit = {'tag': '',
                        'force': 'eV/Ang',
                        'velocity': '(eV/amu)^(1/2)',
                        'charge': '|e|',
                        'initial charge': '|e|',
                        u'magmom': 'μB'}[value]
            except KeyError:
                unit = ''
            text = ''

            rng = mx - mn  # XXX what are optimal allowed range and steps ?
            self.mnmx = [_('min:'),
                         ui.SpinBox(mn, mn - 10 * rng, mx + rng, rng / 10.,
                                    self.change_mnmx),
                         _('max:'),
                         ui.SpinBox(mx, mn - 10 * rng, mx + rng, rng / 10.,
                                    self.change_mnmx),
                         _(unit)]
            self.win.close()
            self.reset(self.gui)

        self.label.text = text
        self.radio.value = value
        self.gui.draw()
        return text  # for testing
コード例 #5
0
    def update_new_direction_and_size_stuff(self):
        if self.needs_4index[self.structure.value]:
            n = 4
        else:
            n = 3

        rows = self.new_direction_and_size_rows

        rows.clear()

        self.new_direction = row = ['(']
        for i in range(n):
            if i > 0:
                row.append(',')
            row.append(ui.SpinBox(0, -100, 100, 1))
        row.append('):')

        if self.method.value == 'wulff':
            row.append(ui.SpinBox(1.0, 0.0, 1000.0, 0.1))
        else:
            row.append(ui.SpinBox(5, 1, 100, 1))

        row.append(ui.Button(_('Add'), self.row_add))

        rows.add(row)

        if self.method.value == 'wulff':
            # Extra widgets for the Wulff construction
            self.size_radio = ui.RadioButtons(
                [_('Number of atoms'), _('Diameter')], ['natoms', 'diameter'],
                self.update_gui_size)
            self.size_natoms = ui.SpinBox(100, 1, 100000, 1,
                                          self.update_size_natoms)
            self.size_diameter = ui.SpinBox(5.0, 0, 100.0, 0.1,
                                            self.update_size_diameter)
            self.round_radio = ui.RadioButtons(
                [_('above  '), _('below  '),
                 _('closest  ')], ['above', 'below', 'closest'],
                callback=self.update)
            self.smaller_button = ui.Button(_('Smaller'), self.wulff_smaller)
            self.larger_button = ui.Button(_('Larger'), self.wulff_larger)
            rows.add(_('Choose size using:'))
            rows.add(self.size_radio)
            rows.add(
                [_('atoms'), self.size_natoms,
                 _(u'ų'), self.size_diameter])
            rows.add(
                _('Rounding: If exact size is not possible, choose the size:'))
            rows.add(self.round_radio)
            rows.add([self.smaller_button, self.larger_button])
            self.update_gui_size()
        else:
            self.smaller_button = None
            self.larger_button = None
コード例 #6
0
ファイル: settings.py プロジェクト: nateharms/ase
    def __init__(self, gui):
        self.gui = gui
        win = ui.Window(_('Settings'))

        # Constraints
        win.add(_('Constraints:'))
        win.add([
            ui.Button(_('Constrain'), self.constrain_selected), '/',
            ui.Button(_('release'), self.release_selected),
            _(' selected atoms')
        ])
        win.add(ui.Button(_('Constrain immobile atoms'), self.immobile))
        win.add(ui.Button(_('Clear all constraints'), self.clear_constraints))

        # Visibility
        win.add(_('Visibility:'))
        win.add([
            ui.Button(_('Hide'), self.hide_selected), '/',
            ui.Button(_('show'), self.show_selected),
            _(' selected atoms')
        ])
        win.add(ui.Button(_('View all atoms'), self.view_all))

        # Miscellaneous
        win.add(_('Miscellaneous:'))
        self.scale = ui.SpinBox(self.gui.images.atom_scale, 0.2, 2.0, 0.1,
                                self.scale_radii)
        win.add([_('Scale atomic radii:'), self.scale])
コード例 #7
0
ファイル: movie.py プロジェクト: puckvg/ase-copy
    def __init__(self, gui):
        self.win = win = ui.Window(_('Movie'), self.close)
        win.add(_('Image number:'))
        self.frame_number = ui.Scale(gui.frame + 1,
                                     1,
                                     len(gui.images),
                                     callback=self.new_frame)
        win.add(self.frame_number)

        win.add([
            ui.Button(_('First'), self.click, -1, True),
            ui.Button(_('Back'), self.click, -1),
            ui.Button(_('Forward'), self.click, 1),
            ui.Button(_('Last'), self.click, 1, True)
        ])

        play = ui.Button(_('Play'), self.play)
        stop = ui.Button(_('Stop'), self.stop)

        # TRANSLATORS: This function plays an animation forwards and backwards
        # alternatingly, e.g. for displaying vibrational movement
        self.rock = ui.CheckButton(_('Rock'))

        win.add([play, stop, self.rock])

        if len(gui.images) > 150:
            skipdefault = len(gui.images) // 150
            tdefault = min(max(len(gui.images) / (skipdefault * 5.0), 1.0), 30)
        else:
            skipdefault = 0
            tdefault = min(max(len(gui.images) / 5.0, 1.0), 30)
        self.time = ui.SpinBox(tdefault, 1.0, 99, 0.1)
        self.skip = ui.SpinBox(skipdefault, 0, 99, 1)
        win.add(
            [_(' Frame rate: '), self.time,
             _(' Skip frames: '), self.skip])

        self.gui = gui
        self.direction = 1
        self.timer = None
        gui.register_vulnerable(self)
コード例 #8
0
ファイル: rotate.py プロジェクト: maurergroup/ase_local
 def __init__(self, gui):
     self.gui = gui
     win = ui.Window(_('Rotate'))
     win.add(_('Rotation angles:'))
     self.rotate = [ui.SpinBox(42.0, -360, 360, 1, self.change)
                    for i in '123']
     win.add(self.rotate)
     win.add(ui.Button(_('Update'), self.update_angles))
     win.add(_('Note:\nYou can rotate freely\n'
               'with the mouse, by holding\n'
               'down mouse button 2.'))
     self.update_angles()
コード例 #9
0
ファイル: settings.py プロジェクト: maurergroup/ase_local
    def __init__(self, gui):
        self.gui = gui
        win = ui.Window(_('Settings'))

        # Constraints
        win.add(_('Constraints:'))
        win.add([ui.Button(_('Fix'), self.constrain_selected),
                 '/',
                 ui.Button(_('release'), self.release_selected),
                 _(' selected atoms')])
        win.add(ui.Button(_('Clear all constraints'), self.clear_constraints))

        # Visibility
        win.add(_('Visibility:'))
        win.add([ui.Button(_('Hide'), self.hide_selected),
                 '/',
                 ui.Button(_('show'), self.show_selected),
                 _(' selected atoms')])
        win.add(ui.Button(_('View all atoms'), self.view_all))

        # Miscellaneous
        win.add(_('Miscellaneous:'))
        self.scale = ui.SpinBox(self.gui.images.atom_scale,
                                0.2, 2.0, 0.1, self.scale_radii)
        win.add([_('Scale atomic radii:'), self.scale])
        self.force_vector_scale = ui.SpinBox(
            self.gui.force_vector_scale,
            0.0, 1e32, 0.1,
            rounding=2,
            callback=self.scale_force_vectors
        )
        win.add([_('Scale force vectors:'), self.force_vector_scale])
        self.velocity_vector_scale = ui.SpinBox(
            self.gui.velocity_vector_scale,
            0.0, 1e32, 0.1,
            rounding=2,
            callback=self.scale_velocity_vectors
        )
        win.add([_('Scale velocity vectors:'), self.velocity_vector_scale])
コード例 #10
0
    def add_direction(self, direction, layers, energy):
        i = len(self.direction_table_rows)

        if self.method.value == 'wulff':
            spin = ui.SpinBox(energy, 0.0, 1000.0, 0.1, self.update)
        else:
            spin = ui.SpinBox(layers, 1, 100, 1, self.update)

        up = ui.Button(_('Up'), self.row_swap_next, i - 1)
        down = ui.Button(_('Down'), self.row_swap_next, i)
        delete = ui.Button(_('Delete'), self.row_delete, i)

        self.direction_table_rows.add(
            [str(direction) + ':', spin, up, down, delete])
        up.active = i > 0
        down.active = False
        delete.active = i > 0

        if i > 0:
            down, delete = self.direction_table_rows[-2][3:]
            down.active = True
            delete.active = True
コード例 #11
0
ファイル: repeat.py プロジェクト: martin-stoehr/ase-devel
    def __init__(self, gui):
        win = ui.Window(_('Repeat'))
        win.add(_('Repeat atoms:'))
        self.repeat = [ui.SpinBox(r, 1, 9, 1, self.change)
                       for r in gui.images.repeat]
        win.add(self.repeat)
        win.add(ui.Button(_('Set unit cell'), self.set_unit_cell))

        for sb, vec in zip(self.repeat, gui.atoms.cell):
            if not vec.any():
                sb.active = False

        self.gui = gui
コード例 #12
0
    def __init__(self, gui):
        self.gui = gui
        win = self.win = ui.Window(_('Add atoms'))
        win.add(_('Specify chemical symbol, formula, or filename.'))

        def choose_file():
            chooser = ui.ASEFileChooser(self.win.win)
            filename = chooser.go()
            if filename is None:  # No file selected
                return

            self.combobox.value = filename

            # Load the file immediately, so we can warn now in case of error
            self.readfile(filename, format=chooser.format)

        if self.gui.images.selected.any():
            default = current_selection_string
        else:
            default = 'H2'

        self._filename = None
        self._atoms_from_file = None

        from ase.collections import g2
        labels = list(sorted(name for name in g2.names if len(g2[name]) > 1))
        values = labels

        combobox = ui.ComboBox(labels, values)
        win.add([
            _('Add:'), combobox,
            ui.Button(_('File ...'), callback=choose_file)
        ])
        combobox.widget.bind('<Return>', lambda e: self.add())

        combobox.value = default
        self.combobox = combobox

        spinners = [
            ui.SpinBox(0.0, -1e3, 1e3, 0.1, rounding=2, width=3)
            for __ in range(3)
        ]

        win.add([_('Coordinates:')] + spinners)
        self.spinners = spinners
        win.add(
            _('Coordinates are relative to the center of the selection, '
              'if any, else absolute.'))
        self.picky = ui.CheckButton(_('Check positions'), True)
        win.add([ui.Button(_('Add'), self.add), self.picky])
        self.focus()
コード例 #13
0
ファイル: nanotube.py プロジェクト: essil1/ase-laser
    def __init__(self, gui):
        self.element = Element('C', self.make)
        self.bondlength = ui.SpinBox(1.42, 0.0, 10.0, 0.01, self.make)
        self.n = ui.SpinBox(5, 1, 100, 1, self.make)
        self.m = ui.SpinBox(5, 0, 100, 1, self.make)
        self.length = ui.SpinBox(1, 1, 100, 1, self.make)
        self.description = ui.Label('')

        win = self.win = ui.Window(_('Nanotube'))
        win.add(ui.Text(introtext))
        win.add(self.element)
        win.add([_('Bond length: '), self.bondlength, _(u'Å')])
        win.add(_('Select roll-up vector (n,m) and tube length:'))
        win.add(['n:', self.n, 'm:', self.m, _('Length:'), self.length])
        win.add(self.description)
        win.add([
            pybutton(_('Creating a nanoparticle.'), self.make),
            ui.Button(_('Apply'), self.apply),
            ui.Button(_('OK'), self.ok)
        ])

        self.gui = gui
        self.atoms = None
コード例 #14
0
ファイル: add.py プロジェクト: essil1/ase-laser
    def __init__(self, gui):
        self.gui = gui
        win = self.win = ui.Window(_('Add atoms'))
        win.add(_('Specify chemical symbol, formula, or filename.'))

        def set_molecule(value):
            self.entry.value = value
            self.focus()

        def choose_file():
            chooser = ui.ASEFileChooser(self.win.win)
            filename = chooser.go()
            if filename is None:  # No file selected
                return

            self.entry.value = filename

            # Load the file immediately, so we can warn now in case of error
            self.readfile(filename, format=chooser.format)

        self.entry = ui.Entry('', callback=self.add)
        win.add([
            _('Add:'), self.entry,
            ui.Button(_('File ...'), callback=choose_file)
        ])

        self._filename = None
        self._atoms_from_file = None

        from ase.collections import g2
        labels = list(sorted(g2.names))
        values = labels

        box = ui.ComboBox(labels, values, callback=set_molecule)
        win.add([_('Get molecule:'), box])
        box.value = 'H2'

        spinners = [
            ui.SpinBox(0.0, -1e3, 1e3, 0.1, rounding=2, width=3)
            for __ in range(3)
        ]

        win.add([_('Coordinates:')] + spinners)
        self.spinners = spinners
        win.add(
            _('Coordinates are relative to the center of the selection, '
              'if any, else absolute.'))
        self.picky = ui.CheckButton(_('Check positions'), True)
        win.add([ui.Button(_('Add'), self.add), self.picky])
        self.focus()
コード例 #15
0
    def __init__(self, gui):
        self.element = Element('', self.apply)
        self.structure = ui.ComboBox(structures, structures,
                                     self.structure_changed)
        self.structure_warn = ui.Label('', 'red')
        self.orthogonal = ui.CheckButton('', True, self.make)
        self.lattice_a = ui.SpinBox(3.2, 0.0, 10.0, 0.001, self.make)
        self.retrieve = ui.Button(_('Get from database'),
                                  self.structure_changed)
        self.lattice_c = ui.SpinBox(None, 0.0, 10.0, 0.001, self.make)
        self.x = ui.SpinBox(1, 1, 30, 1, self.make)
        self.x_warn = ui.Label('', 'red')
        self.y = ui.SpinBox(1, 1, 30, 1, self.make)
        self.y_warn = ui.Label('', 'red')
        self.z = ui.SpinBox(1, 1, 30, 1, self.make)
        self.vacuum_check = ui.CheckButton('', False, self.vacuum_checked)
        self.vacuum = ui.SpinBox(5, 0, 40, 0.01, self.make)
        self.description = ui.Label('')

        win = self.win = ui.Window(_('Surface'))
        win.add(ui.Text(introtext))
        win.add(self.element)
        win.add([_('Structure:'), self.structure, self.structure_warn])
        win.add([_('Orthogonal cell:'), self.orthogonal])
        win.add([_('Lattice constant:')])
        win.add([_('\ta'), self.lattice_a, (u'Å'), self.retrieve])
        win.add([_('\tc'), self.lattice_c, (u'Å')])
        win.add([_('Size:')])
        win.add([_('\tx: '), self.x, _(' unit cells'), self.x_warn])
        win.add([_('\ty: '), self.y, _(' unit cells'), self.y_warn])
        win.add([_('\tz: '), self.z, _(' unit cells')])
        win.add([_('Vacuum: '), self.vacuum_check, self.vacuum, (u'Å')])
        win.add(self.description)
        # TRANSLATORS: This is a title of a window.
        win.add([
            pybutton(_('Creating a surface.'), self.make),
            ui.Button(_('Apply'), self.apply),
            ui.Button(_('OK'), self.ok)
        ])

        self.element.grab_focus()
        self.gui = gui
        self.atoms = None
        self.lattice_c.active = False
        self.vacuum.active = False
        self.structure_changed()
コード例 #16
0
    def __init__(self, gui):
        self.atoms = None
        self.no_update = True
        self.old_structure = 'undefined'

        win = self.win = ui.Window(_('Nanoparticle'))
        win.add(ui.Text(introtext))

        self.element = Element('', self.apply)
        lattice_button = ui.Button(_('Get structure'), self.set_structure_data)
        self.elementinfo = ui.Label(' ')
        win.add(self.element)
        win.add(self.elementinfo)
        win.add(lattice_button)

        # The structure and lattice constant
        labels = []
        values = []
        self.needs_4index = {}
        self.needs_2lat = {}
        self.factory = {}
        for abbrev, name, n4, c, factory in self.structure_data:
            labels.append(name)
            values.append(abbrev)
            self.needs_4index[abbrev] = n4
            self.needs_2lat[abbrev] = c
            self.factory[abbrev] = factory
        self.structure = ui.ComboBox(labels, values, self.update_structure)
        win.add([_('Structure:'), self.structure])
        self.fourindex = self.needs_4index[values[0]]

        self.a = ui.SpinBox(3.0, 0.0, 1000.0, 0.01, self.update)
        self.c = ui.SpinBox(3.0, 0.0, 1000.0, 0.01, self.update)
        win.add([_('Lattice constant:  a ='), self.a, ' c =', self.c])

        # Choose specification method
        self.method = ui.ComboBox(
            [_('Layer specification'),
             _('Wulff construction')], ['layers', 'wulff'],
            self.update_gui_method)
        win.add([_('Method: '), self.method])

        self.layerlabel = ui.Label('Missing text')  # Filled in later
        win.add(self.layerlabel)
        self.direction_table_rows = ui.Rows()
        win.add(self.direction_table_rows)
        self.default_direction_table()

        win.add(_('Add new direction:'))
        self.new_direction_and_size_rows = ui.Rows()
        win.add(self.new_direction_and_size_rows)
        self.update_new_direction_and_size_stuff()

        # Information
        win.add(_('Information about the created cluster:'))
        self.info = [
            _('Number of atoms: '),
            ui.Label('-'),
            _('   Approx. diameter: '),
            ui.Label('-')
        ]
        win.add(self.info)

        # Finalize setup
        self.update_structure('fcc')
        self.update_gui_method()
        self.no_update = False

        self.auto = ui.CheckButton(_('Automatic Apply'))
        win.add(self.auto)

        win.add([
            pybutton(_('Creating a nanoparticle.'), self.makeatoms),
            ui.helpbutton(helptext),
            ui.Button(_('Apply'), self.apply),
            ui.Button(_('OK'), self.ok)
        ])

        self.gui = gui
        self.smaller_button = None
        self.largeer_button = None

        self.element.grab_focus()