本文整理汇总了Python中gi.repository.GdkPixbuf.Pixbuf.new_from_resource方法的典型用法代码示例。如果您正苦于以下问题:Python Pixbuf.new_from_resource方法的具体用法?Python Pixbuf.new_from_resource怎么用?Python Pixbuf.new_from_resource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.GdkPixbuf.Pixbuf
的用法示例。
在下文中一共展示了Pixbuf.new_from_resource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_show_about
# 需要导入模块: from gi.repository.GdkPixbuf import Pixbuf [as 别名]
# 或者: from gi.repository.GdkPixbuf.Pixbuf import new_from_resource [as 别名]
def on_show_about(self, *args):
dlg = Gtk.AboutDialog('RunSQLRun', self.win)
logo = Pixbuf.new_from_resource(
'/org/runsqlrun/icons/128x128/runsqlrun.png')
dlg.set_logo(logo)
dlg.set_program_name('RunSQLRun')
dlg.set_version(__version__)
dlg.set_copyright('2015 Andi Albrecht <[email protected]>')
dlg.set_license_type(Gtk.License.MIT_X11)
dlg.set_website('http://runsqlrun.org')
dlg.set_authors(['Andi Albrecht'])
dlg.run()
dlg.destroy()
示例2: __init__
# 需要导入模块: from gi.repository.GdkPixbuf import Pixbuf [as 别名]
# 或者: from gi.repository.GdkPixbuf.Pixbuf import new_from_resource [as 别名]
def __init__(self, app):
super(MainWindow, self).__init__(application=app, title='RunSQLRun')
self.app = app
self.set_default_size(800, 600)
self.set_icon(Pixbuf.new_from_resource(
'/org/runsqlrun/icons/runsqlrun.svg'))
self.headerbar = HeaderBar(self)
self.set_titlebar(self.headerbar)
self.docview = DocViewer(self)
self.statusbar = Gtk.Statusbar()
self.statusbar.set_margin_top(0)
self.statusbar.set_margin_bottom(0)
self.statusbar.push(303, 'Ready when you are')
GObject.timeout_add(3000, self.statusbar.pop, 303)
self.statusbar.set_spacing(6)
self.statusbar.pack_end(ConnectionIndicator(self), False, False, 0)
vbox = Gtk.VBox()
vbox.pack_start(self.docview, True, True, 0)
vbox.pack_start(self.statusbar, False, False, 0)
self.add(vbox)
# TODO: Statusbar
# save and restore window settings
if self.app.config.get('window-maximized'):
self.maximize()
size_setting = self.app.config.get('window-size')
if size_setting is not None:
self.resize(size_setting[0], size_setting[1])
position_setting = self.app.config.get('window-position')
if position_setting is not None:
self.move(position_setting[0], position_setting[1])
self.connect('window-state-event', self.on_window_state_event)
self.connect('configure-event', self.on_configure_event)
# Actions
self._setup_actions()
self.show_all()