Return to

A decent GTK Application Tutorial?

Ok, i have the “need” for a pretty specific application i’m not able to find for Linux. Since I’m on Linux, instead of putting up with it, i plan on just doing it myself. Gnome is my current choice of DE. I also think making it a GTK Application probably would be the best option for compatibility, should anyone else find it usefull.
I have done GUI Applications before, but windows only. I tried following some of the GTK provided documentation, but feel pretty lost.

The basics i’m trying to do for now, are a basic music player. Just a seek bar, 4 buttons and being able to play a single file. I’ll add functionality later. I started with gtk builder and am able to somewhat put a UI together, but have no clue how to even begin with playing media files.

So, anyone know of a decent, half way recent tutorial for this? Or should i just say f*ck it and do it as an electron app or similar?

If you’re interested, here’s the “end” goal: I play guitar. For learning and transcribing Music, i need a player with some specific features. On Windows there are similar tools (free or paid), but i haven’t found one for Linux. I need adjustable playback speed, pitch shifting, looping sections and a few things more. I know that some music players offer similar functionality, but it’s often burried in menus and especially playback speed is used all the time, often auto increasing over each itteration etc. Foobar or such just don’t provide a decent interface for changing those parameters on the fly.

Hi, GTK+ is amazing, it has its quirks, but it works really nice. Also it supports CSS so you can pretty much modify the look and feel of everything in your app.

GTK+ is made in C but it also supports Python. If your project is going to be big and complex (or you require low level access to the OS), I suggest using C++. If not, you can speed the development process by using python.

The GUI can be made programmatically, but is challenging and can be confusing. Use a GUI editor, I use Glade , it creates your GUI files in XML format.

There are a lot of tutorials, but there is not a definitive one. You have to try it out and “get your hands dirty”.

If you choose the C/C++ route, use this tutorial as a starting point . If you go with Python, check this link.

Here is the GTK3 reference manual.

Also, there is no “official IDE”, I use Netbeans, which is top dog. Also you probably need to dive a little bit in the Makefile rabitt hole.

1 Like

Yes. Since it’s not supposed to be performatic :man_shrugging: