veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

296
active users

#tkinter

0 posts0 participants0 posts today

So... I wanted to package my Python app using tkinter UI library (it is just good enough for my purpose) as a flatpak. Flatpaks are based on "runtimes" similar to docker base images.

As I did obviously not use any "big" UI framework (Gnome or KDE) and it already provides Python with tkinter, I decided to use the org.freedesktop.Platform as a runtime for my flatpak. The first challenge was to get the dbus-python package to compile, as it requires a dbus binary for compiling it. So I added the freedesktop DBus implementation. I need dbus functionallity, as it allows me to use the "XDG Desktop Portals" to interactively open files when running in the flatpak sandbox. After this, everything worked! :neocat_happy:

Unfortunately, the application cannot load any proper font, so it falls back to the 90s era fonts compiled statically into Tcl/Tk (which tkinter is based on). After some trial and error, and finding out how add custom fonts to Tk, I disovered that the freedesktop runtime does not ship freedesktop fontconfig. And also I can't add it that easily to the build step, too, as the bundled Tk installation does not link to it anyway… :neocat_angry:

Replied in thread

Now I have a working app. The table in the first screen capture is compiled into the Teensy. A Tkinter app on my Mac reads it and generates the UI in the second screen capture. All the controls change the sound in real time.

I can make several good drum sounds, and it's just a matter of tweaking them. The reverb sounds like a walkie-talkie in a bucket, though. I may have introduced a bug...

🧵 10/∞

Replied in thread

I didn't find anything that would make it easy, so I started writing a UI from scratch. I spent a few hours in tkinter and knocked out a sketch of what I'm thinking of.

tkinter is weird. But it's mature and reasonably well documented.

Now I'll need to write a little bidirectional serial protocol so the Teensy can tell me what actual parameters it has and this UI can tell the Teensy when to change them.

🧵 9/∞