start work
This commit is contained in:
parent
3c39477f66
commit
818594fa78
4 changed files with 48 additions and 0 deletions
0
music/__init__.py
Normal file
0
music/__init__.py
Normal file
38
music/application.py
Normal file
38
music/application.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
import sys
|
||||
import gi
|
||||
gi.require_version('Gtk', '4.0')
|
||||
gi.require_version('Adw', '1')
|
||||
from gi.repository import Gtk, Adw
|
||||
|
||||
|
||||
class MainWindow(Gtk.ApplicationWindow):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Things will go here
|
||||
self.box1 = Gtk.Box()
|
||||
self.set_child(self.box1)
|
||||
|
||||
self.button = Gtk.Button(label="Hello")
|
||||
self.box1.append(self.button)
|
||||
self.button.connect('clicked', self.hello)
|
||||
|
||||
self.header = Gtk.HeaderBar()
|
||||
self.set_titlebar(self.header)
|
||||
self.open_button = Gtk.Button(label="Open")
|
||||
self.header.pack_start(self.open_button)
|
||||
self.open_button.set_icon_name("document-open-symbolic")
|
||||
|
||||
def hello(self, button):
|
||||
print("Hello world")
|
||||
|
||||
class MyApp(Adw.Application):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.connect('activate', self.on_activate)
|
||||
|
||||
def on_activate(self, app):
|
||||
self.win = MainWindow(application=app)
|
||||
self.win.present()
|
||||
|
||||
app = MyApp(application_id="com.example.GtkApplication")
|
||||
app.run(sys.argv)
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
PyGObject
|
9
shell.nix
Normal file
9
shell.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
let
|
||||
pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/b62d2a95c72fb068aecd374a7262b37ed92df82b.tar.gz") {};
|
||||
in pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.python313.withPackages (python-pkgs: with python-pkgs; [
|
||||
pygobject3
|
||||
]))
|
||||
];
|
||||
}
|
Loading…
Add table
Reference in a new issue