本文整理匯總了Python中gtk.Label.set_markup方法的典型用法代碼示例。如果您正苦於以下問題:Python Label.set_markup方法的具體用法?Python Label.set_markup怎麽用?Python Label.set_markup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gtk.Label
的用法示例。
在下文中一共展示了Label.set_markup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from gtk import Label [as 別名]
# 或者: from gtk.Label import set_markup [as 別名]
def __init__(self, parent, backend):
self.backend = backend
self.dialog = GtkAboutDialog()
self.dialog.set_transient_for(parent)
self.dialog.set_modal(True)
self.dialog.set_name(_("Subscription Manager"))
self.dialog.set_license(LICENSE)
self.dialog.set_wrap_license(True)
self.dialog.set_website("https://fedorahosted.org/subscription-manager/")
self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc."))
self.dialog.set_logo(gdk.pixbuf_new_from_file_at_size(LOGO_PATH, 100, 100))
rhsm_version_label = Label()
backend_version_label = Label()
context_box = self.dialog.vbox.get_children()[0]
context_box.pack_end(rhsm_version_label)
context_box.pack_end(backend_version_label)
# Set the component versions.
versions = get_version_dict(self.backend.uep)
self.dialog.set_version(versions['subscription manager'])
rhsm_version_label.set_markup(_("<b>python-rhsm version:</b> %s" % \
versions['python-rhsm']))
backend_version_label.set_markup(_("<b>remote entitlement server version:</b> %s" % \
versions['candlepin']))
self.dialog.connect("response", self._handle_response)
self.dialog.show_all()
示例2: __init__
# 需要導入模塊: from gtk import Label [as 別名]
# 或者: from gtk.Label import set_markup [as 別名]
def __init__(self, parent, backend):
self.backend = backend
self.dialog = GtkAboutDialog()
self.dialog.set_transient_for(parent)
self.dialog.set_modal(True)
self.dialog.set_name(_("Subscription Manager"))
self.dialog.set_license(LICENSE)
self.dialog.set_wrap_license(True)
if not get_running_as_firstboot():
self.dialog.set_website("https://fedorahosted.org/subscription-manager/")
self.dialog.set_copyright(_("Copyright (c) 2012 Red Hat, Inc."))
self.dialog.set_logo_icon_name("subscription-manager")
self.dialog.set_icon_name("subscription-manager")
next_update_label = Label()
rhsm_version_label = Label()
backend_version_label = Label()
context_box = self.dialog.vbox.get_children()[0]
context_box.pack_end(next_update_label)
context_box.pack_end(rhsm_version_label)
context_box.pack_end(backend_version_label)
self._set_next_update(next_update_label)
# Set the component versions.
server_versions = get_server_versions(self.backend.cp_provider.get_consumer_auth_cp())
client_versions = get_client_versions()
self.dialog.set_version(client_versions['subscription-manager'])
rhsm_version_label.set_markup(_("<b>python-rhsm version:</b> %s") %
client_versions['python-rhsm'])
backend_version_label.set_markup(_("<b>subscription management service version:</b> %s") %
server_versions['candlepin'])
self.dialog.connect("response", self._handle_response)
self.dialog.show_all()