Mouse_Keyboard/1.0.2/core/window.py

44 lines
1.0 KiB
Python
Raw Normal View History

2022-08-27 08:50:01 +00:00
# Python imports
2022-08-28 04:24:12 +00:00
import os
2022-08-27 08:50:01 +00:00
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
# Application imports
from .container import Container
2022-08-28 04:24:12 +00:00
2022-08-27 08:50:01 +00:00
class Window(Gtk.ApplicationWindow):
"""docstring for Window."""
def __init__(self, args, unknownargs):
super(Window, self).__init__()
2022-08-28 04:24:12 +00:00
self._SCRIPT_PTH = os.path.dirname(os.path.realpath(__file__))
2022-08-27 08:50:01 +00:00
self.setup_styling()
self.setup_signals()
self.add(Container())
self.show_all()
def setup_styling(self):
2022-08-28 04:24:12 +00:00
self.set_icon_from_file(f"{self._SCRIPT_PTH}/../resources/icon.png")
2022-08-27 08:50:01 +00:00
self.set_title(app_name)
self.set_default_size(800, 200)
2022-08-28 04:24:12 +00:00
self.set_accept_focus(False)
self.set_skip_taskbar_hint(True)
self.set_skip_pager_hint(True)
2022-08-27 08:50:01 +00:00
self.set_type_hint(3) # 3 = TOOLBAR
self.set_gravity(8) # 5 = CENTER, 8 = SOUTH
self.set_position(1) # 1 = CENTER, 4 = CENTER_ALWAYS
self.stick()
def setup_signals(self):
self.connect("delete-event", Gtk.main_quit)