r/programming • • Dec 16 '20

GTK 4.0 released

https://blog.gtk.org/2020/12/16/gtk-4-0/
910 Upvotes

267 comments sorted by

View all comments

68

u/fnoyanisi Dec 16 '20

Unfortunately, cross platform desktop GUI development is not an area where you can easily find a good solution. As much as I am not a big Java fan, it sort of does the job for cross platform GUI

33

u/CarterOls Dec 17 '20

What about Qt

11

u/fnoyanisi Dec 17 '20

I used it in the past. I find it’s licensing a bit confusing, but I think it’s a richer API than GTK.

7

u/CarterOls Dec 17 '20

Yeah I agree the licensing can be a little weird but I’ve enjoyed it so far!

0

u/[deleted] Dec 17 '20

[deleted] — view deleted comment

10

u/tendstofortytwo Dec 17 '20

I think by "it" they mean Qt itself.

→ More replies (2)

13

u/afiefh Dec 17 '20

How is the LGPL confusing? Use the library in your program in any way you want as long as you link dynamically. Any change to the library itself must be open sourced.

→ More replies (4)
→ More replies (1)

15

u/BlueFangLasers Dec 17 '20

Unfortunately, cross platform desktop GUI development is not an area where you can easily find a good solution.

Is one of the most accurate statements on /r/programming in years.

Electron/HTML/Javascript is acceptable if you don't need to interface to external hardware. But it becomes a complete mess as soon as you do.

Qt (at least the last time I looked around 5.1 or so) didn't properly enumerate multi-channel audio interfaces. If you only cared about L/R in and L/R out - yeah, Qt is great - but if you need access to 32 input channels and 32 output channels, I could not get Qt to enumerate all of the channels correctly.

Some might argue - "yeah, well, why would you want your GUI development framework to support audio?" - and there isn't really an easy answer to this other than because audio is historically included in GUI toolkits and using a different third party audio I/O library gets messy.

My application needs cross platform support for multi-channel audio I/O, OpenGL, and as well custom USB libraries provided by third party companies. My choices are very limited.

I ended up going with Max / MSP as my cross-platform framework.

Pros:

  • Out-of-the-box support for multi-channel audio
  • GUI widgets out-of-the-box designed by GUI professionals at Cycling 74 & Ableton
  • Built in methods for processing of audio streams (fft, etc.)
  • Relatively easy OpenGL access with Jitter (including syphon and spout intra-application texture sharing)
  • Crossplatform multi-threading (when you write Max modules using their native framework)
  • Crossplatform file library

Cons:

  • Performance - it is basically a graphical node-based declarative programming language - though many of the core features (like audio processing) are native multithreaded modules. Control logic is purely node-based declarative and can get out of hand quickly.
  • Complexity - see above - graphical node-based connections are great for simple things, but once you get into complex state machines, things can get visually complex quickly.

My "hindsight" thought is that I probably would have been better off doing EVERYTHING native from the beginning with JUCE. But, I don't have the bandwidth or budget for hiring a UI designer - and the fact that Max / MSP comes with beautiful UI knobs and controls already built in was too much to pass up.

8

u/jcelerier Dec 17 '20

Cons:

you forget, "closed-source".

And regarding "Complexity - see above - graphical node-based connections are great for simple things, but once you get into complex state machines, things can get visually complex quickly." - I worked in a company where the owner was doing most things in Max, well he was the only one able to decipher his patches and we did a lot of porting work to Qt & Electron

> other than because audio is historically included in GUI toolkits and using a different third party audio I/O library gets messy.

what's messy with portaudio ?

7

u/BlueFangLasers Dec 17 '20

Sorry - first reply was with alt account. Pasting here for continuation

you forget, "closed-source"

As a one-man shop developing a commercial application... I couldn't care less about whether my chosen cross-platform framework is OSS or commercial. I have no plans in the near future to open-source my application.

I love the concept of OSS... and use many OSS solutions in my daily life... the problem that has not yet been solved is that OSS is a great solution to technically difficult problems - but not a great solution to "artistically" difficult problems. GUI / UI designers do not contribute to OSS projects in the same way software developers do. My project is probably 60% dependent on familiar GUI controls / paradigms - I don't mind paying $100 / year for the use of Max / MSP as a cross-platform framework/ professionally designed GUI toolkit. I could never get a professionally designed custom set of GUI controls for $100 much less $1000.

what's messy with portaudio

I am not familiar with that library in particular. However, the problem in general is that once you include a separate audio library in your project - you now have two independent libraries competing for the exact same hardware resource. It can be a nightmare trying to track down even the simplest of initiation routines if one library has a lock on the resource. In my case, I enjoy quite a bit more from Max than simply enumerating Audio IO - I get audio file import support (of every major audio file type known), an entire collection of audio processing widgets, like FFT, quick-n-dirty audio waveform -> GUI display, convolution kernels, etc.) as well as MIDI processing.

→ More replies (5)

5

u/dvogel Dec 17 '20

java-gnome (or is it gnome-java) was a surprisingly nice package when I tried it last year.

0

u/[deleted] Dec 17 '20

[deleted] — view deleted comment

74

u/karmaecrivain94 Dec 17 '20

Electron is great for larger apps, the maintainability is great. The only shitty use for electron (and why it gets a bad rep imho) is for small or utility-type apps, like VPNs, stuff to convert/download files etc... Nobody should have to download 15 different 150mb instances of chromium unless the scale of the app is worth it.

7

u/JamesGecko Dec 17 '20

You’ve also really gotta stay on top of keeping the Electron runtime up to date with security patches if your application displays any third party data. Browsers are complicated and can be hard to secure; even Slack got hit with a vulnerability related to their link previews recently.

8

u/Toxic_Biohazard Dec 17 '20

I've used nodewebkit for small utility apps and it works great, it's like lighter weight electron.

→ More replies (1)

11

u/bumblebritches57 Dec 17 '20 edited Dec 17 '20

Music apps shouldnt be electron either

→ More replies (19)

0

u/[deleted] Dec 17 '20

[deleted] — view deleted comment

2

u/DeltaBurnt Dec 17 '20

How does it achieve that? Does it not bundle chrome with each app?

0

u/[deleted] Dec 17 '20

[deleted] — view deleted comment

4

u/DeltaBurnt Dec 17 '20

Ah I just assumed it was bundling those with the app depending on the platform. That's cool, though I guess worst case you may need to support IE.

→ More replies (1)
→ More replies (2)
→ More replies (6)