本文整理汇总了Python中gi.repository.Gtk.Spinner方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.Spinner方法的具体用法?Python Gtk.Spinner怎么用?Python Gtk.Spinner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gtk
的用法示例。
在下文中一共展示了Gtk.Spinner方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: spinner_set_active
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def spinner_set_active(self, active):
"""
Enables/disables the Gtk.Spinner, while showing/hiding it at the same
time
@param active: True if the spinner should spin
"""
self.should_spinner_be_shown = active
if active:
if isinstance(self.spinner, Gtk.Spinner):
self.spinner.start()
self.spinner.show()
else:
self.spinner.hide()
if isinstance(self.spinner, Gtk.Spinner):
self.spinner.stop()
示例2: add_spinner
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def add_spinner(self):
self.spinner = Gtk.Spinner()
self.spinner.props.active = True
self.is_spinning = False
apply_styling_to_widget(self.spinner, self.SPINNER_CSS)
示例3: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(self):
Gtk.Overlay.__init__(self)
self._loading = False
self._blur = Gtk.EventBox()
self._blur.get_style_context().add_class('blur')
self._spinner = Gtk.Spinner()
self._spinner.props.active = True
apply_styling_to_widget(self._spinner, KanoButton.SPINNER_CSS)
示例4: _fill_top_box
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def _fill_top_box(self, box):
""" Fill header with service's icon, name, and a spinner
for inidcation of work.
"""
box.set_spacing(10)
self.image_icon = Gtk.Image()
self.image_icon.set_size_request(48, 48)
self.human_name_label = Gtk.Label()
self.human_name_label.set_alignment(xalign=0, yalign=0.5)
# FIXME in the newer versions of GTK3 there always be Spinner!
try:
self.spinner = Gtk.Spinner()
except AttributeError:
# worarkound for archlinux: bug #624204
self.spinner = Gtk.Box()
self.spinner.connect("show", self.on_spinner_show)
self.spinner.set_size_request(32, 32)
align_spin = Gtk.Alignment.new(1, 0, 0, 0)
align_spin.add(self.spinner)
box.set_spacing(10)
box.pack_start(self.image_icon, False, True, 0)
box.pack_start(self.human_name_label, True, True, 0)
box.pack_start(align_spin, False, True, 0)
示例5: on_sync_started
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def on_sync_started(self, sender, backend_id):
"""
If the backend has started syncing tasks, update the state of the
Gtk.Spinner
@param sender: not used, here only for signal callback compatibility
@param backend_id: the id of the backend that emitted this signal
"""
if backend_id == self.backend.get_id():
self.spinner_set_active(True)
示例6: on_sync_ended
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def on_sync_ended(self, sender, backend_id):
"""
If the backend has stopped syncing tasks, update the state of the
Gtk.Spinner
@param sender: not used, here only for signal callback compatibility
@param backend_id: the id of the backend that emitted this signal
"""
if backend_id == self.backend.get_id():
self.spinner_set_active(False)
示例7: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(self):
Gtk.Box.__init__(self)
self.set_valign(Gtk.Align.CENTER)
self.set_halign(Gtk.Align.CENTER)
self._spinner = Gtk.Spinner()
self.add(self._spinner)
self.show_all()
示例8: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(self, discoverer):
self.discoverer = discoverer
self.widgets = uistuff.GladeWidgets("discovererDialog.glade")
# =======================================================================
# Clear glade defaults
# =======================================================================
for child in self.widgets["enginesTable"].get_children():
self.widgets["enginesTable"].remove(child)
self.finished = False
self.throbber = None
self.nameToBar = {}
discoverer.pre_discover()
binnames = self.discoverer.toBeRechecked.keys()
if len(binnames) == 0:
self.finished = True
# ======================================================================
# Insert the names to be discovered
# ======================================================================
for i, name in enumerate(binnames):
label = Gtk.Label(label=name + ":")
label.props.xalign = 1
self.widgets["enginesTable"].attach(label, 0, 1, i, i + 1)
bar = Gtk.ProgressBar()
self.widgets["enginesTable"].attach(bar, 1, 2, i, i + 1)
self.nameToBar[name] = bar
# =======================================================================
# Add throbber
# =======================================================================
self.throbber = Gtk.Spinner()
self.throbber.set_size_request(50, 50)
self.widgets["throbberDock"].add(self.throbber)
# =======================================================================
# Show the window
# =======================================================================
self.widgets["discovererDialog"].set_position(
Gtk.WindowPosition.CENTER_ON_PARENT)
self.widgets["discovererDialog"].show_all()
self.throbber.start()
示例9: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(
self, transient_for,
headline=_("Export Theme"),
width=150,
height=80
):
Gtk.Dialog.__init__(self, headline, transient_for, 0)
self.set_default_size(width, height)
self.label = CenterLabel()
self.spinner = Gtk.Spinner()
# Scrollable log window:
self.log = Gtk.TextView()
self.log.set_editable(False)
# self.log.set_cursor_visible(False)
self.log.override_font(
# @TODO: make log size configurable?
Pango.font_description_from_string("monospace 8")
)
self.log.set_wrap_mode(Gtk.WrapMode.CHAR)
#
self.scrolled_window = Gtk.ScrolledWindow(expand=True)
self.scrolled_window.set_margin_bottom(5)
self.scrolled_window.add(self.log)
#
adj = self.scrolled_window.get_vadjustment()
adj.connect(
'changed',
lambda adj: adj.set_value(adj.get_upper() - adj.get_page_size())
)
self.options_box = Gtk.Box(
orientation=Gtk.Orientation.VERTICAL, spacing=5
)
self.options_box.set_margin_top(5)
self.options_box.set_margin_bottom(15)
self.apply_button = Gtk.Button(label=_("_Apply Options and Export"), use_underline=True)
self.apply_button.connect("clicked", lambda x: self.do_export())
self.error_box = Gtk.Box(
orientation=Gtk.Orientation.VERTICAL, spacing=5
)
self.error_box.set_margin_bottom(10)
self.box = self.get_content_area()
self.box.set_margin_left(5)
self.box.set_margin_right(5)
self.box.set_spacing(5)
self.top_area = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.box.add(self.top_area)
self.top_area.add(self.label)
self.show_all()
self.box.add(self.spinner)
self.box.add(self.scrolled_window)
示例10: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(self, parent, username, cookie, tokens, codeString, vcodetype):
super().__init__(_('Verification..'), parent, Gtk.DialogFlags.MODAL)
self.set_default_size(280, 130)
self.set_border_width(10)
self.username = username
self.cookie = cookie
self.tokens = tokens
self.codeString = codeString
self.vcodetype = vcodetype
box = self.get_content_area()
box.set_spacing(5)
self.vcode_img = Gtk.Image()
box.pack_start(self.vcode_img, True, True, 0)
button_box = Gtk.Box(spacing=5)
box.pack_start(button_box, True, True, 0)
self.vcode_entry = Gtk.Entry()
self.vcode_entry.connect('activate', self.check_entry)
button_box.pack_start(self.vcode_entry, True, True, 0)
if Config.GTK_GE_312:
vcode_refresh = Widgets.IconButton('view-refresh-symbolic')
else:
vcode_refresh = Gtk.Button.new_from_stock(Gtk.STOCK_REFRESH)
vcode_refresh.props.valign = Gtk.Align.CENTER
vcode_refresh.connect('clicked', self.on_vcode_refresh_clicked)
button_box.pack_start(vcode_refresh, False, False, 0)
# show loading process
self.loading_spin = Gtk.Spinner()
self.loading_spin.props.valign = Gtk.Align.CENTER
button_box.pack_start(self.loading_spin, False, False, 0)
vcode_confirm = Gtk.Button.new_from_stock(Gtk.STOCK_OK)
vcode_confirm.connect('clicked', self.on_vcode_confirm_clicked)
vcode_confirm.props.valign = Gtk.Align.END
box.pack_start(vcode_confirm, False, False, 10)
box.show_all()
self.loading_spin.hide()
gutil.async_call(auth.get_signin_vcode, cookie, codeString,
callback=self.update_img)
示例11: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Spinner [as 别名]
def __init__(self, widget, notebook, page, navigation):
Dialog.__init__(self, widget, _('Search'), # T: Dialog title
buttons=Gtk.ButtonsType.CLOSE, help='Help:Searching',
defaultwindowsize=(400, 300)
)
self.page = page
hbox = Gtk.HBox(spacing=5)
self.vbox.pack_start(hbox, False, True, 0)
hbox.pack_start(Gtk.Label(_('Search') + ': '), False, True, 0) # T: input label
self.query_entry = InputEntry()
hbox.add(self.query_entry)
self.search_button = Gtk.Button.new_with_mnemonic(_('_Find')) # T: Button label
hbox.pack_start(self.search_button, False, True, 0)
self.spinner = Gtk.Spinner()
hbox.pack_start(self.spinner, False, True, 0)
self.cancel_button = Gtk.Button.new_with_mnemonic(_('_Cancel')) # T: Button label
hbox.pack_start(self.cancel_button, False, True, 0)
self._set_state(self.READY)
help_text = _(
'For advanced search you can use operators like\n'
'AND, OR and NOT. See the help page for more details.'
) # T: help text for the search dialog
self.query_entry.set_tooltip_text(help_text)
self.namespacecheckbox = Gtk.CheckButton.new_with_mnemonic(_('Limit search to the current page and sub-pages'))
# T: checkbox option in search dialog
if page is not None:
self.vbox.pack_start(self.namespacecheckbox, False, True, 0)
# TODO advanced query editor
# TODO checkbox _('Match c_ase')
# TODO checkbox _('Whole _word')
self.results_treeview = SearchResultsTreeView(notebook, navigation)
self.vbox.pack_start(ScrolledWindow(self.results_treeview), True, True, 0)
self.search_button.connect_object('clicked', self.__class__._search, self)
self.cancel_button.connect_object('clicked', self.__class__._cancel, self)
self.query_entry.connect_object('activate', self.__class__._search, self)