本文整理匯總了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()