本文整理汇总了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
示例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
示例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()