Python gi.repository.Gtk.ApplicationWindow() Examples

The following are 3 code examples of gi.repository.Gtk.ApplicationWindow(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module gi.repository.Gtk , or try the search function .
Example #1
Source File: window.py    From Authenticator with GNU General Public License v2.0 5 votes vote down vote up
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() 
Example #2
Source File: gui_utilities.py    From king-phisher with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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() 
Example #3
Source File: SubProcess.py    From pychess with GNU General Public License v3.0 5 votes vote down vote up
def do_activate(self):
        if not self.window:
            self.window = Gtk.ApplicationWindow(application=self)

        self.window.present()