Compare commits
2 Commits
8c15252151
...
b42d45a5b8
| Author | SHA1 | Date | |
|---|---|---|---|
| b42d45a5b8 | |||
| a9d0b7d3a2 |
32
lib/mbs/framework/desktop/DesktopApplication.py
Normal file
32
lib/mbs/framework/desktop/DesktopApplication.py
Normal file
@ -0,0 +1,32 @@
|
||||
from ..Application import Application
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
class DesktopApplication(Application):
|
||||
|
||||
def __init__(self, application_id : str):
|
||||
Application.__init__(self)
|
||||
|
||||
self.app = Gtk.Application(application_id=application_id)
|
||||
self.app.connect("activate", self.activate)
|
||||
self.app.connect("startup", self.startup)
|
||||
|
||||
def before_start_internal(self):
|
||||
pass
|
||||
|
||||
def before_stop_internal(self):
|
||||
pass
|
||||
|
||||
def _start_internal(self):
|
||||
self.app.run()
|
||||
|
||||
def _stop_internal(self):
|
||||
exit(0)
|
||||
|
||||
def activate(self, args):
|
||||
pass
|
||||
def startup(self, args):
|
||||
pass
|
||||
28
lib/mbs/framework/desktop/Window.py
Normal file
28
lib/mbs/framework/desktop/Window.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2024 Michael Becker <alcexhim@gmail.com>
|
||||
#
|
||||
# This file is part of framework-python.
|
||||
#
|
||||
# framework-python is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# framework-python is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with framework-python. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
class Window (Gtk.Window):
|
||||
|
||||
def __init__(self, type=None):
|
||||
super().__init__()
|
||||
|
||||
self.connect("realize", self.on_realize)
|
||||
|
||||
def on_realize(self, data):
|
||||
pass
|
||||
19
lib/mbs/framework/desktop/__init__.py
Normal file
19
lib/mbs/framework/desktop/__init__.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Copyright (C) 2024 Michael Becker <alcexhim@gmail.com>
|
||||
#
|
||||
# This file is part of framework-python.
|
||||
#
|
||||
# framework-python is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# framework-python is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with framework-python. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
from .DesktopApplication import DesktopApplication
|
||||
from .Window import Window
|
||||
Loading…
x
Reference in New Issue
Block a user