Commit aa9ae872 authored by gregh's avatar gregh
Browse files

wip: test gui file

parent a5779e9c
Pipeline #1382 failed with stage
in 58 seconds
......@@ -9,13 +9,14 @@ import gi
if gi.require_version("Gtk", "4.0"):
pass
from gi.repository import Gtk, Gio
from pathlib import Path
from gi.repository import Gio, Gtk
from matplotlib.backend_bases import MouseEvent
from matplotlib.backends.backend_gtk4 import NavigationToolbar2GTK4 as NavigationToolbar
from matplotlib.backends.backend_gtk4agg import FigureCanvasGTK4Agg as FigureCanvas
from matplotlib.figure import Figure
from pudb import set_trace as bp # noqa
from pathlib import Path
import radiocc
......@@ -27,20 +28,17 @@ class Application(Gtk.Application):
def __init__(self, PATH_UI: Path, **kwargs):
super().__init__(**kwargs)
self.connect('activate', self.on_activate, PATH_UI)
self.connect("activate", self.on_activate, PATH_UI)
def on_activate(self, app: Gtk.Application, PATH_UI: Path):
self.builder = Gtk.Builder()
self.builder.add_from_file(
str(PATH_UI)
)
self.builder.add_from_file(str(PATH_UI))
self.window = self.builder.get_object("window")
self.window.set_application(app)
self.text = self.builder.get_object("text")
self.button = self.builder.get_object("button")
self.window.show()
# self.window.show()
# self.scrolled_window_matplotlib = self.builder.get_object(
......
......@@ -5,11 +5,27 @@ import gi
if gi.require_version("Gtk", "4.0"):
pass
from gi.repository import Gtk, Gio
from pudb import set_trace as bp
from pathlib import Path
from gi.repository import Gio, Gtk
from pudb import set_trace as bp
class Application(Gtk.Application):
"""User interface data structure."""
def __init__(self, PATH_UI: Path, **kwargs):
super().__init__(**kwargs)
self.connect("activate", self.on_activate, PATH_UI)
def on_activate(self, app: Gtk.Application, PATH_UI: Path):
self.builder = Gtk.Builder()
self.builder.add_from_file(str(PATH_UI))
self.window = self.builder.get_object("window")
self.window.set_application(app)
self.text = self.builder.get_object("text")
self.button = self.builder.get_object("button")
self.window.show()
if __name__ == "__main__":
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment