Re: GTK4
- Posted by petelomax 1 week ago
- 207 views
Here's the tail end of my (mostly pre-existing) rant about GTK4, not that it is likely to help except perhaps to know that you're not alone:
They have got rid of gtk_main() and gtk_init() to be certain that nothing whatsoever works until after the "activate" event has triggered. You cannot even do this:
constant {sx,sy} = gGetGlobal("SCREENSIZE")
So any initial window dependent on that absolutely must be drawn the wrong size, before you can figure out how big you want it, then redrawn the correct size - what's not to like about that?
Mind you, as Phix regularly proves, the presence of any global or static variable/constant will instantly make a program completely unmaintainable. (Sorry, did I miss out a rather emphatic not somewhere in that statement?)
Should you want my opinion, GTK2 got it right and almost does all you might ever need, GTK3 was created because the team felt they were not foisting their opinions of how an application should look and feel on the world forcibly enough [mind you, whatever they did that makes gDrawPolygon 250* faster on GTK3 than it is on GTK2 can only be applauded], and GTK4 was created because they weren't foisting their opinions of how an application should be internally structured and written on the world forcibly enough. [PS: should you be thinking GTK2 has a dated look, that can be overcome.]
The only, and I mean only, possible use of a GtkApplication I could think of is in GTK4_demo so it could use the same instance of GTK4 running multiple "whole source" demos that can start and shutdown independently of each other - which of course is a very specific source management issue, an absolutely miniscule gain over multiple processes, except perhaps for disguising just how long GTK4 takes to fire itself up, the downside of no way to kill a specific one, and no possible justification whatsoever for being imposed on everyone else worldwide.
Coding/porting nightmares aside, in "Q:Does a GtkApplication have x? A:No" I struggle to find anything at all that I can put in place of x that changes the answer. Even "annoyances", "limitations", "disadvantages" don't really fit since it is as a concept so utterly banal and completely meaningless - of course I'm still rather vexed, but talking here about thinking calmly and objectively about the thing itself. Maybe "pointlessness". </rant>
Incidentally, since the IUP sources do not contain "gtk_application_new", I am pretty certain no attempt whatsoever has been made to get that to work on GTK4, and I've not noticed anyone on the IUP mailing list clamouring for it.