當前位置: 首頁>>代碼示例>>Python>>正文


Python GObject.TYPE_INT屬性代碼示例

本文整理匯總了Python中gi.repository.GObject.TYPE_INT屬性的典型用法代碼示例。如果您正苦於以下問題:Python GObject.TYPE_INT屬性的具體用法?Python GObject.TYPE_INT怎麽用?Python GObject.TYPE_INT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在gi.repository.GObject的用法示例。


在下文中一共展示了GObject.TYPE_INT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from gi.repository import GObject [as 別名]
# 或者: from gi.repository.GObject import TYPE_INT [as 別名]
def __init__(self, treeview, max_colour_val):
        Gtk.CellRenderer.__init__(self)
        prop = GObject.Value()
        prop.init(GObject.TYPE_INT)
        treeview.style_get_property("horizontal-separator", prop)
        self.cell_padding = old_div(prop.get_int(),2)
        treeview.style_get_property("grid-line-width", prop)
        self.cell_padding += prop.get_int()
        self.selected_action = None
        self.max_colour_val = max_colour_val 
開發者ID:trackmastersteve,項目名稱:alienfx,代碼行數:12,代碼來源:action_renderer.py

示例2: appendAutowrapColumn

# 需要導入模塊: from gi.repository import GObject [as 別名]
# 或者: from gi.repository.GObject import TYPE_INT [as 別名]
def appendAutowrapColumn(treeview, name, **kvargs):
    cell = Gtk.CellRendererText()
    # cell.props.wrap_mode = Pango.WrapMode.WORD
    # TODO:
    # changed to ellipsize instead until "never ending grow" bug gets fixed
    # see https://github.com/pychess/pychess/issues/1054
    cell.props.ellipsize = Pango.EllipsizeMode.END
    column = Gtk.TreeViewColumn(name, cell, **kvargs)
    treeview.append_column(column)

    def callback(treeview, allocation, column, cell):
        otherColumns = [c for c in treeview.get_columns() if c != column]
        newWidth = allocation.width - sum(c.get_width() for c in otherColumns)

        hsep = GObject.Value()
        hsep.init(GObject.TYPE_INT)
        hsep.set_int(0)
        treeview.style_get_property("horizontal-separator", hsep)
        newWidth -= hsep.get_int() * (len(otherColumns) + 1) * 2
        if cell.props.wrap_width == newWidth or newWidth <= 0:
            return
        cell.props.wrap_width = newWidth
        store = treeview.get_model()
        store_iter = store.get_iter_first()
        while store_iter and store.iter_is_valid(store_iter):
            store.row_changed(store.get_path(store_iter), store_iter)
            store_iter = store.iter_next(store_iter)
        treeview.set_size_request(0, -1)
    # treeview.connect_after("size-allocate", callback, column, cell)

    scroll = treeview.get_parent()
    if isinstance(scroll, Gtk.ScrolledWindow):
        scroll.set_policy(Gtk.PolicyType.NEVER, scroll.get_policy()[1])

    return cell 
開發者ID:pychess,項目名稱:pychess,代碼行數:37,代碼來源:uistuff.py

示例3: __init__

# 需要導入模塊: from gi.repository import GObject [as 別名]
# 或者: from gi.repository.GObject import TYPE_INT [as 別名]
def __init__(self, parent, app):
        super().__init__()
        self.parent = parent
        self.app = app

        # pixbuf, name, path, tooltip, size, humansize,
        # isdir, mtime, human mtime, type, pcs_file
        self.liststore = Gtk.ListStore(GdkPixbuf.Pixbuf, str, str, str,
                                       GObject.TYPE_INT64, str,
                                       GObject.TYPE_INT, GObject.TYPE_INT64,
                                       str, str, str)
        self.init_ui() 
開發者ID:XuShaohua,項目名稱:bcloud,代碼行數:14,代碼來源:IconWindow.py


注:本文中的gi.repository.GObject.TYPE_INT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。