Ejemplo n.º 1
0
    def __init__(self):
        self._compound_type = 'acid'

        # compound selector
        options = get_compound_list('H', 'acid')
        self._compound = widgets.Select(options=options,
                                        layout=widgets.Layout(flex='0 0 auto',
                                                              width='120px',
                                                              height=_element_height))
        self._massfrac = widgets.BoundedFloatText(min=0., max=1.,
                                                  layout=widgets.Layout(flex='2 1 auto'),
                                                  width='auto')

        self._box = widgets.HBox(children=(self._compound,
                                           widgets.Label('MF acid'), self._massfrac),
                                 layout=widgets.Layout(display='flex',
                                                       flex_direction='row'))
Ejemplo n.º 2
0
    def __init__(self):
        self._compound_type = 'acid'

        # compound selector
        options = get_compound_list('H', 'acid')
        self._compound = widgets.Select(options=options,
                                        layout=widgets.Layout(
                                            flex='0 0 auto',
                                            width='120px',
                                            height=_element_height))
        self._massfrac = widgets.BoundedFloatText(
            min=0.,
            max=1.,
            layout=widgets.Layout(flex='2 1 auto'),
            width='auto')

        self._box = widgets.HBox(children=(self._compound,
                                           widgets.Label('MF acid'),
                                           self._massfrac),
                                 layout=widgets.Layout(display='flex',
                                                       flex_direction='row'))
Ejemplo n.º 3
0
    def _populate(self, sender, *args, **kwargs):
        element_name = self._element.value
        out = get_compound_list(element_name, self._compound_type)

        if out is not None:
            self._compound.options = list(map(str, out))
Ejemplo n.º 4
0
    def _populate(self, sender, *args, **kwargs):
        element_name = self._element.value
        out = get_compound_list(element_name, self._compound_type)

        if out is not None:
            self._compound.options = list(map(str, out))