Most of the resources I found on Motif are either outdated to the point where I don’t know what to do with them, with documentation that assumes I know what I am doing, incomplete, or without specification files(?).
I got to talking with a friend of mine, and I quote: “Why don’t you write the Motif/GUI part of your application in C then?” - And I suppose that could be possible?
Could I write my GUI with C, and then write the rest of my application in Ada, accessing the subprograms through callbacks from the Motif event loop? Would this make sense? What are the pitfalls here?
Yes, you can do it this way.
Ada is really good at foreign function interfacing… but I wouldn’t recommend doing that unless you have to.
I remember that thread; it did spark a question in my mind: would an Ada implementation of X11 be something people would use?
(I don’t really know; though I kind of get the feeling that, especially if it was done to be portable [say Win, OpenVMS, and Linux], it would be very useful for being able to interface/upgrade current in-use legacy systems.)
There’s a surprising number of people in Linux-land who want X11 over Wayland, hence why a portable implementation might be a good way to get an Ada “killer program” out. Just imagine an implementation that:
Was easy to port, no #ifdef BS, no autotools, no make;
used Ada’s DSA, if possible;
used the Task construct;
used the language features (ie type, subtype, pre-/post-conditions, SPARK-proving, etc), rather than being a transliteration of/or binding; and
was well-commented with informational/explainatory comments.
I, for one, would use it. It’s tried and true, it’s stable, and honestly, Motif just has that comforting feel.
That’s their loss.
This is probably the most important.
So, what would it really take to make an implementation like this? If anybody has seen my post history, I’m a PLC programmer, so things here are quite different for me.
I might be more of a pragmatic person than others, but I actually really like the approach of leaving C stuff in C unless you want to make some proper high level bindings that hide the C-isms. This allows you to wrap the GUI stuff in some nice project specific bindings that you can call from Ada and “black box” the rest of the GUI from the Ada perspective. The FFI in Ada is excellent and as I see it there’s little cost in doing this (aside from the usual gripes about C that is
Given the current state of the Linux world cantanima is probably right. It seems many of them are on a trajectory that will make Wayland the default (or already have). Personally I’ll probably be using X11 until it becomes a head-ache to stubornly keep using it (yells at cloud
I am taking this as a ‘yes, go ahead and do what you suggested, I vouch for it’ comment?
I am in the same camp. Heard of Xlibre? Repo here. I don’t think X is going to die. It’s just not going to have the same corporate backing as it used to, and that Wayland has now.
Nice, thanks for the tip! I heard about Xlibre in passing somewhere, but haven’t thought about it since. But wowzers that “about” page is spiiiiiicy . Apparently there’s a lot of stuff I missed. But I do think you’re right about X not going to die. Whenever there’s a couple of nerds interested enough, they can pretty much fork something and keep working on it, like what happened with Gnome 2, or many other projects. It even happens when a previously proprietary project is opened up like with CDE.
Funny, I use NsCDE as my daily. I didn’t know actual CDE was opened up and available like that. Thanks for that. There is also Extended Motif Window Manager, which I used extensively for quite a while - Pretty much why I am so hung up on Motif.
There are a lot of GUI toolkits available today. If C++ code is acceptable, I suggest to use Qt.
Modern graphics hardware doesn’t map to ideas behind X11. Same make most of GUI toolkits available now obsolete. Completely new rendering engines are necessary to utilize modern graphics hardware, to support Unicode text drawing, etc.
I appreciate the sentiment, but I am not asking for alternatives. All it takes is a quick search and one will be overwhelmed by the possibilities for GUI development.
‘Obsolete’, by its very definition means that it is no longer in use, not maintained, or neglected, which are all false for Motif and X11(libre?) referred to previously in this thread. And people like me do not use modern graphics hardware. I have to go through hoops just to access this forum.
There is a very specific reason for why I am asking about this obsolete toolkit.
That being said, Qt does have very nice features, it just doesn’t do it for me.
This shouldn’t be a big problem though: Ada is wonderful at allowing you to separate out (and abstract) things.
(IIRC)
Motif is the GUI stuff, X is the protocol stuff.
That means that you could have (eg) an implementation of X (say for Windows) in Delphi, that would use the VCL.
(Again, IIRC)
This.
While I do think that Ada could use something like Delphi’s VCL, but crossplatform, that is a BIG undertaking. (Remember, the VCL is an OOP hierarchy that encapsulates [and integrates] the Win32 API so that all the components are, by default, Windows elements.)
What reason is that?
I don’t mean to kinda “crap all over the floor”, but GUI is kinda that way (a big mess), and moreso when you’re talking about adding in a distribution/remote scheme — so knowing what you want to do, and its purpose, might be really helpful in deciding what to do.
If all you need is a remote-access GUI-ish way to interface/control your application then allow me to suggest Gnoga.
I didn’t know about Xlibre. That’s interesting. Searching for more information about that and related concerns led me to Phoenix X, which seems relevant to that side topic in this discussion. It is an (as of yet incomplete) rewrite of X in Zig.