clan-core/pkgs/clan-vm-manager
Qubasa 1a36ef242f
Some checks failed
checks / test (pull_request) Failing after 1m14s
checks-impure / test (pull_request) Successful in 1m15s
Fixed failing tests in machines and history cli, removed test_machines_api.py
2023-12-14 18:25:42 +01:00
..
bin clan-vm-manager: prepend local clan-cli to python path 2023-11-23 15:30:44 +01:00
clan_vm_manager Fixed failing tests in machines and history cli, removed test_machines_api.py 2023-12-14 18:25:42 +01:00
.envrc clan-vm-manager: add nix package 2023-11-23 15:30:44 +01:00
clan-vm-manager.code-workspace Reworked machines list, and history commands 2023-12-14 18:21:10 +01:00
default.nix move mypy/ipdb to devshell 2023-12-06 17:16:28 +01:00
flake-module.nix clan-vm-manager: add nix package 2023-11-23 15:30:44 +01:00
pyproject.toml re-add 'U' ruff type category 2023-12-06 17:11:17 +01:00
README.md gui re-rendering & cleanup 2023-12-02 16:16:48 +01:00
shell.nix move mypy/ipdb to devshell 2023-12-06 17:16:28 +01:00

Developing GTK3 Applications

Here we will document on how to develop GTK3 application UI in python. First we want to setup an example code base to look into. In this case gnome-music.

Setup gnome-music as code reference

gnome-music does not use glade

Clone gnome-music and check out the tag v40.0 gnome-music

git clone git@github.com:GNOME/gnome-music.git && cd gnome-music && git checkout 40.0

Checkout nixpkgs version 468cb5980b56d348979488a74a9b5de638400160 for the correct gnome-music devshell then execute:


nix develop /home/username/Projects/nixpkgs#gnome.gnome-music

Look into the file gnome-music.in which bootstraps the application.

Setup gnu-cash as reference

Gnucash uses glade with complex UI Setup gnucash

git clone git@github.com:Gnucash/gnucash.git
git checkout ed4921271c863c7f6e0c800e206b25ac6e9ba4da

cd nixpkgs
git checkout 015739d7bffa7da4e923978040a2f7cba6af3270
nix develop /home/username/Projects/nixpkgs#gnucash
mkdir build && cd build
cmake ..
cd ..
make
  • The use the GTK Builder instead of templates.

Look into virt-manager it uses python + spice-gtk

Look into virtManager/details/viewers.py to see how spice-gtk is being used

git clone https://github.com/virt-manager/virt-manager

Glade

Make sure to check the 'composit' box in glade in the GtkApplicationWindow to be able to import the glade file through GTK template