예제 #1
0
def add_combo_text_column(combo, data_func=None, **kwargs):
    kwargs["xalign"] = kwargs.get("xalign", 0.0)
    kwargs, col_attrs = parse_kwargs(**kwargs)
    rend = get_default_renderer('text', **kwargs)
    add_renderer_with_attrs(combo, col_attrs, rend)
    if data_func != None:
        callback, args = parse_callback(data_func)
        combo.set_cell_data_func(rend, callback, args)
    return rend
예제 #2
0
def add_combo_text_column(combo,
        data_func=None,
        **kwargs):
    kwargs["xalign"] = kwargs.get("xalign", 0.0)
    kwargs, col_attrs = parse_kwargs(**kwargs)
    rend = get_default_renderer('text', **kwargs)
    add_renderer_with_attrs(combo, col_attrs, rend)
    if data_func!=None:
        callback, args = parse_callback(data_func)
        combo.set_cell_data_func(rend, callback, args)
    return rend
예제 #3
0
def new_text_column(title,
                    edited_callback=None,
                    data_func=None,
                    spacing=0,
                    visible=True,
                    resizable=True,
                    sizing=0,
                    fixed_width=-1,
                    min_width=-1,
                    max_width=-1,
                    expand=True,
                    clickable=False,
                    alignment=None,
                    reorderable=False,
                    sort_column_id=-1,
                    sort_indicator=False,
                    sort_order=gtk.SORT_ASCENDING,
                    **kwargs):
    """
        Creates a TreeViewColumn packed with a CellRendererText .
    """
    kwargs, col_attrs = parse_kwargs(**kwargs)
    alignment = alignment if alignment is not None else kwargs["xalign"]

    rend = get_default_renderer(gtk.CellRendererText, **kwargs)
    if edited_callback is not None:
        callback, args = parse_callback(edited_callback, reduce=False)
        rend.connect('edited', callback, *args)

    col = _get_default_column(title,
                              rend,
                              data_func=data_func,
                              spacing=spacing,
                              visible=visible,
                              resizable=resizable,
                              sizing=sizing,
                              fixed_width=fixed_width,
                              min_width=min_width,
                              max_width=max_width,
                              expand=expand,
                              clickable=clickable,
                              alignment=alignment,
                              reorderable=reorderable,
                              sort_column_id=sort_column_id,
                              sort_indicator=sort_indicator,
                              sort_order=sort_order,
                              col_attrs=col_attrs)
    return col
예제 #4
0
def new_text_column(title,
        edited_callback=None,
        data_func=None,
        spacing=0,
        visible=True,
        resizable=True,
        sizing=0,
        fixed_width=-1,
        min_width=-1,
        max_width=-1,
        expand=True,
        clickable=False,
        alignment=None,
        reorderable=False,
        sort_column_id=-1,
        sort_indicator=False,
        sort_order=gtk.SORT_ASCENDING,
        **kwargs):
    """
        Creates a TreeViewColumn packed with a CellRendererText .
    """
    kwargs, col_attrs = parse_kwargs(**kwargs)
    alignment = alignment if alignment is not None else kwargs["xalign"]

    rend = get_default_renderer(gtk.CellRendererText, **kwargs)
    if edited_callback is not None:
        callback, args = parse_callback(edited_callback, reduce=False)
        rend.connect('edited', callback, *args)

    col = _get_default_column(
        title, rend,
        data_func=data_func,
        spacing=spacing,
        visible=visible,
        resizable=resizable,
        sizing=sizing,
        fixed_width=fixed_width,
        min_width=min_width,
        max_width=max_width,
        expand=expand,
        clickable=clickable,
        alignment=alignment,
        reorderable=reorderable,
        sort_column_id=sort_column_id,
        sort_indicator=sort_indicator,
        sort_order=sort_order,
        col_attrs=col_attrs)
    return col