本文整理汇总了Python中gi.repository.GObject.property方法的典型用法代码示例。如果您正苦于以下问题:Python GObject.property方法的具体用法?Python GObject.property怎么用?Python GObject.property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GObject
的用法示例。
在下文中一共展示了GObject.property方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_button
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import property [as 别名]
def add_button(self, button):
"""
All buttons must be added before doing InfoBarNotebook.push_message()
"""
if not isinstance(button, InfoBarMessageButton):
raise TypeError("Not an InfoBarMessageButton: %s" % repr(button))
self.buttons.append(button)
button._button = Gtk.InfoBar.add_button(self, button.text,
button.response_id)
def set_sensitive(button, property):
if self.get_children():
self.set_response_sensitive(button.response_id,
button.sensitive)
button.connect("notify::sensitive", set_sensitive)
def set_tooltip_text(button, property):
button._button.set_property("tooltip-text", button.tooltip_text)
button.connect("notify::tooltip-text", set_tooltip_text)
示例2: _connect_signals
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import property [as 别名]
def _connect_signals(self):
"""
connect to various rhythmbox signals that the toolbars need
"""
self.sh_display_page_tree = self.shell.props.display_page_tree.connect(
"selected", self.on_page_change
)
self.sh_psc = self.shell_player.connect("playing-song-changed",
self._sh_on_song_change)
self.sh_op = self.shell_player.connect("elapsed-changed",
self._sh_on_playing)
self.sh_pc = self.shell_player.connect("playing-changed",
self._sh_on_playing_change)
self.sh_pspc = self.shell_player.connect(
"playing-song-property-changed",
self._sh_on_song_property_changed)
self.rb_settings = Gio.Settings.new('org.gnome.rhythmbox')
self.rb_settings.bind('show-album-art', self, 'show_album_art',
Gio.SettingsBindFlags.GET)
self.connect('notify::show-album-art',
self.show_album_art_settings_changed)
self.show_album_art_settings_changed(None)
self.rb_settings.bind('show-song-position-slider', self,
'show_song_position_slider',
Gio.SettingsBindFlags.GET)
self.connect('notify::show-song-position-slider',
self.show_song_position_slider_settings_changed)
self.show_song_position_slider_settings_changed(None)
示例3: _sh_on_song_property_changed
# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import property [as 别名]
def _sh_on_song_property_changed(self, sp, uri, property, old, new):
"""
shell-player "playing-song-property-changed" signal handler
"""
if sp.get_playing() and property in \
('artist',
'album',
'title',
RB.RHYTHMDB_PROP_STREAM_SONG_ARTIST,
RB.RHYTHMDB_PROP_STREAM_SONG_ALBUM,
RB.RHYTHMDB_PROP_STREAM_SONG_TITLE):
entry = sp.get_playing_entry()
self.toolbar_type.display_song(entry)