本文整理汇总了Python中gi.repository.Gtk.ApplicationWindow方法的典型用法代码示例。如果您正苦于以下问题:Python Gtk.ApplicationWindow方法的具体用法?Python Gtk.ApplicationWindow怎么用?Python Gtk.ApplicationWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gtk
的用法示例。
在下文中一共展示了Gtk.ApplicationWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ApplicationWindow [as 别名]
def __init__(self):
Gtk.ApplicationWindow.__init__(self, type=Gtk.WindowType.TOPLEVEL)
self.set_icon_name("com.github.bilelmoussaoui.Authenticator")
self.resize(550, 600)
self.restore_state()
AccountsManager.get_default()
self._build_widgets()
self.show_all()
示例2: __init__
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ApplicationWindow [as 别名]
def __init__(self, application):
"""
:param application: The parent application for this object.
:type application: :py:class:`Gtk.Application`
"""
utilities.assert_arg_type(application, Gtk.Application, arg_pos=1)
self.config = application.config
"""A reference to the King Phisher client configuration."""
self.application = application
"""The parent :py:class:`Gtk.Application` instance."""
self.logger = logging.getLogger('KingPhisher.Client.' + self.__class__.__name__)
builder = Gtk.Builder()
self.gtk_builder = builder
"""A :py:class:`Gtk.Builder` instance used to load Glade data with."""
top_level_dependencies = [gobject.name for gobject in self.dependencies.children if isinstance(gobject, GladeProxy)]
top_level_dependencies.append(self.dependencies.name)
if self.dependencies.top_level is not None:
top_level_dependencies.extend(self.dependencies.top_level)
builder.add_objects_from_file(which_glade(), top_level_dependencies)
builder.connect_signals(self)
gobject = builder.get_object(self.dependencies.name)
setattr(self, self.top_gobject, gobject)
if isinstance(gobject, Gtk.Window):
gobject.set_transient_for(self.application.get_active_window())
self.application.add_reference(self)
if isinstance(gobject, Gtk.ApplicationWindow):
application.add_window(gobject)
if isinstance(gobject, Gtk.Dialog):
gobject.set_modal(True)
self.gobjects = utilities.FreezableDict()
"""A :py:class:`~king_phisher.utilities.FreezableDict` which maps gobjects to their unique GTK Builder id."""
self._load_child_dependencies(self.dependencies)
self.gobjects.freeze()
self._load_child_proxies()
if self.objects_persist:
self.objects_load_from_config()
示例3: do_activate
# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import ApplicationWindow [as 别名]
def do_activate(self):
if not self.window:
self.window = Gtk.ApplicationWindow(application=self)
self.window.present()