예제 #1
0
def CheckBoxLabel(title, *args, **kw):
    tooltipText = kw.pop('tooltipText', None)

    cb = CheckBox(*args, **kw)
    lab = Label(title, fg_color=cb.fg_color)
    lab.mouse_down = cb.mouse_down

    if tooltipText:
        cb.tooltipText = tooltipText
        lab.tooltipText = tooltipText

    class CBRow(Row):
        margin = 0

        @property
        def value(self):
            return self.checkbox.value

        @value.setter
        def value(self, val):
            self.checkbox.value = val

    row = CBRow((lab, cb))
    row.checkbox = cb
    return row
예제 #2
0
def CheckBoxLabel(title, *args, **kw):
    tooltipText = kw.pop('tooltipText', None)

    cb = CheckBox(*args, **kw)
    lab = Label(title, fg_color=cb.fg_color)
    lab.mouse_down = cb.mouse_down

    if tooltipText:
        cb.tooltipText = tooltipText
        lab.tooltipText = tooltipText

    class CBRow(Row):
        margin = 0

        @property
        def value(self):
            return self.checkbox.value

        @value.setter
        def value(self, val):
            self.checkbox.value = val

    row = CBRow((lab, cb))
    row.checkbox = cb
    return row
예제 #3
0
def CheckBoxLabel(title, *args, **kw):
    tooltipText = kw.pop('tooltipText', None)

    l_kw = {'margin': 0}
    b_kw = {'margin': 0}
    expand = kw.pop('expand', 'none')
    r_kw = {}
    if expand != 'none':
        r_kw['expand'] = expand

    align = kw.pop('align', None)
    if align:
        r_kw['align'] = align

    cb = CheckBox(*args, **kw)
    lab = Label(title, fg_color=cb.fg_color)
    lab.mouse_down = cb.mouse_down

    if tooltipText:
        cb.tooltipText = tooltipText
        lab.tooltipText = tooltipText

    class CBRow(Row):
        margin = 0

        @property
        def value(self):
            return self.checkbox.value

        @value.setter
        def value(self, val):
            self.checkbox.value = val

    row = CBRow((Column((lab, ), **l_kw), Column((cb, ), **b_kw)), **r_kw)
    row.checkbox = cb
    return row
예제 #4
0
def CheckBoxLabel(title, *args, **kw):
    tooltipText = kw.pop('tooltipText', None)

    l_kw = {'margin': 0}
    b_kw = {'margin': 0}
    expand = kw.pop('expand', 'none')
    r_kw = {}
    if expand != 'none':
        r_kw['expand'] = expand

    align = kw.pop('align', None)
    if align:
        r_kw['align'] = align

    cb = CheckBox(*args, **kw)
    lab = Label(title, fg_color=cb.fg_color)
    lab.mouse_down = cb.mouse_down

    if tooltipText:
        cb.tooltipText = tooltipText
        lab.tooltipText = tooltipText

    class CBRow(Row):
        margin = 0

        @property
        def value(self):
            return self.checkbox.value

        @value.setter
        def value(self, val):
            self.checkbox.value = val

    row = CBRow((Column((lab,), **l_kw), Column((cb,), **b_kw)), **r_kw)
    row.checkbox = cb
    return row