本文整理汇总了Python中gi.repository.Gtk.ListBoxRow方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.ListBoxRow方法的具体用法?Python Gtk.ListBoxRow怎么用?Python Gtk.ListBoxRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gtk
的用法示例。
在下文中一共展示了Gtk.ListBoxRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_auto_hide
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def _setup_auto_hide(self):
key = self._schema.get_key("auto-close")
row = Gtk.ListBoxRow()
row.set_tooltip_text(key.get_description())
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox.pack_start(vbox, True, True, 10)
label = Gtk.Label(key.get_summary(), xalign=0)
vbox.pack_start(label, True, True, 0)
switch = Gtk.Switch()
switch.props.valign = Gtk.Align.CENTER
self._settings.bind(
"auto-close", switch, "active", Gio.SettingsBindFlags.DEFAULT
)
hbox.pack_start(switch, False, True, 10)
self.listbox.add(row)
示例2: _setup_auto_hide_timeout
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def _setup_auto_hide_timeout(self):
key = self._schema.get_key("timeout")
row = Gtk.ListBoxRow()
row.set_tooltip_text(key.get_description())
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox.pack_start(vbox, True, True, 10)
label = Gtk.Label(" " + key.get_summary(), xalign=0)
vbox.pack_start(label, True, True, 0)
scale = Gtk.Scale().new(Gtk.Orientation.HORIZONTAL)
key_range = key.get_range()
scale.set_range(key_range[1][0], key_range[1][1])
scale.set_digits(False)
scale.set_size_request(128, 24)
scale.connect("format_value", self._scale_timeout_format)
self._settings.bind(
"timeout", scale.get_adjustment(), "value", Gio.SettingsBindFlags.DEFAULT,
)
hbox.pack_start(scale, False, True, 10)
self._row_timeout = row
self.listbox.add(row)
示例3: _setup_mixer_command
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def _setup_mixer_command(self):
key = self._schema.get_key("mixer-command")
row = Gtk.ListBoxRow()
row.set_tooltip_text(key.get_description())
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox.pack_start(vbox, True, True, 10)
label = Gtk.Label(key.get_summary(), xalign=0)
vbox.pack_start(label, True, True, 0)
entry = Gtk.Entry().new()
self._settings.bind(
"mixer-command", entry, "text", Gio.SettingsBindFlags.DEFAULT
)
hbox.pack_start(entry, False, True, 10)
self.listbox.add(row)
示例4: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self):
self.icons_imageboxes = {}
self.icons_templates = {}
super().__init__()
self.set_margin_left(10)
self.set_margin_right(10)
self.set_selection_mode(Gtk.SelectionMode.NONE)
row = Gtk.ListBoxRow()
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
row.add(hbox)
for icon in IconsNames:
icon_imagebox = ScaledImage(width=48)
hbox.pack_start(icon_imagebox, True, True, 0)
self.icons_imageboxes[icon.name] = icon_imagebox
self.add(row)
self.show_all()
示例5: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self, data, chapter):
"""
Holds data that is chapter name and chapter_link that is link to chapter file. For use as ListBox element.
:param data:
:param chapter:
"""
super(Gtk.ListBoxRow, self).__init__()
# Remember chapter name and file link
self.data = data
self.chapter_link = chapter
# Just a bunch of label styling
label = Gtk.Label(xalign=0)
label.set_text(data)
label.set_justify(Gtk.Justification.LEFT)
try:
label.set_margin_start(10)
except AttributeError:
label.set_margin_left(10)
label.set_width_chars(20)
label.set_ellipsize(Pango.EllipsizeMode.END)
self.add(label)
示例6: make_2x_row
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def make_2x_row(text1, text2):
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
label1 = Gtk.Label()
label1.set_text(text1)
label1.set_margin_left(12)
label1.set_margin_right(12)
label2 = Gtk.Label()
text2_for_label=text2
if not text2_for_label:
text2_for_label="Unassigned"
label2.set_markup("<span color=\"#818181\">"+text2_for_label+"</span>")
label2.set_margin_left(12)
label2.set_margin_right(12)
box.set_margin_top(12)
box.set_margin_bottom(12)
label1.set_size_request(200, 0)
label2.set_size_request(200, 0)
box.pack_start(label1, True, True, 0)
box.pack_start(label2, True, False, 0)
row = Gtk.ListBoxRow()
row.add(box)
row.value={'key': text1, 'val': text2}
return row
示例7: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self, account):
"""
:param account: Account
"""
Gtk.ListBoxRow.__init__(self)
self.get_style_context().add_class("account-row")
self._account = account
self.check_btn = Gtk.CheckButton()
self._account.connect("otp_updated", self._on_pin_updated)
self._build_widget()
self.show_all()
示例8: addReminder
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def addReminder(self,desc,date):
row = Gtk.ListBoxRow()
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=50)
row.add(hbox)
ldesc = Gtk.Label(desc, xalign=0)
ldate = Gtk.Label(date, xalign=0)
cdone = Gtk.CheckButton()
hbox.pack_start(ldesc, True, True, 0)
hbox.pack_start(ldate, False, True, 0)
hbox.pack_start(cdone, False, True, 0)
self.lsbReminders.add(row)
#############
# Events #
#############
示例9: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self, *args, **kwargs):
Gtk.ListBoxRow.__init__(self, *args, **kwargs)
self.filter_name = self.get_property('filter-name')
self.filter_all = self.get_property('filter-all')
self.filter_label = self.do_filter_label()
self.filter_value = self.set_filter_value()
self.connect('realize', self.on_filter_name_updated)
self.connect('notify::filter_name', self.on_filter_name_updated)
self.show()
示例10: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self, *args, **kwargs):
Gtk.ListBoxRow.__init__(self, *args, **kwargs)
self.stream = self.get_property('stream')
self.callback = self.get_property('callback')
self.connect('realize', self.on_fixture_updated)
self.connect('notify::stream', self.on_fixture_updated)
add_widget_class(self, 'stream-item')
self.show()
示例11: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def __init__(self, description=None, label='', marked=False):
Gtk.ListBoxRow.__init__(self)
self.label = label # person name for sorting
self.description = description # useed to store person handle
self.marked = marked # is bookmarked (used to sorting)
示例12: add_to_panel
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def add_to_panel(self, row):
"""
Add found item to panel (ListBox).
row - ListBoxRow
"""
self.list_box.prepend(row)
row.show_all()
示例13: add_no_result
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def add_no_result(self, text):
"""
Add only one row with no results label.
"""
row = ListBoxRow()
row.add(Gtk.Label(text))
self.clear_items()
self.list_box.add(row)
row.show_all()
示例14: _setup_ui
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def _setup_ui(self):
self.set_type_hint(Gdk.WindowTypeHint.NORMAL)
box = self.get_content_area()
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box.pack_start(hbox, True, True, 20)
self.listbox = Gtk.ListBox()
self.listbox.set_selection_mode(Gtk.SelectionMode.NONE)
hbox.pack_start(self.listbox, True, True, 10)
row = Gtk.ListBoxRow()
row.set_activatable(False)
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
row.add(hbox)
label = Gtk.Label(xalign=0)
label.set_markup("<b>volctl settings</b>")
hbox.pack_start(label, False, True, 10)
self.listbox.add(row)
self._setup_auto_hide()
self._setup_auto_hide_timeout()
self._setup_mouse_wheel_step()
self._setup_mixer_command()
self.show_all()
self._set_timeout_show()
示例15: _setup_mouse_wheel_step
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ListBoxRow [as 别名]
def _setup_mouse_wheel_step(self):
key = self._schema.get_key("mouse-wheel-step")
row = Gtk.ListBoxRow()
row.set_tooltip_text(key.get_description())
hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
row.add(hbox)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
hbox.pack_start(vbox, True, True, 10)
label = Gtk.Label(key.get_summary(), xalign=0)
vbox.pack_start(label, True, True, 0)
scale = Gtk.Scale().new(Gtk.Orientation.HORIZONTAL)
key_range = key.get_range()
scale.set_range(key_range[1][0], key_range[1][1])
scale.set_digits(False)
scale.set_size_request(128, 24)
scale.connect("format_value", self._scale_mouse_wheel_step_format)
self._settings.bind(
"mouse-wheel-step",
scale.get_adjustment(),
"value",
Gio.SettingsBindFlags.DEFAULT,
)
hbox.pack_start(scale, False, True, 10)
self.listbox.add(row)