I developed some structural design applications in Fortran.
Now I want a GUI.
I first tried Gtk. I gave up. It took me days and still no success. Each time I thought I was where I wanted, another dependency popped up.
Then I made a Web based interface. It’s OK but not exactly what I wanted. Moreover it depends on MS .NET, so I think it won’t work on other platforms. and it supposes some knowledge of C#, HTML, CSS, .NET, JavaScript, ASP.NET …
I’m a retired structural engineer, no software engineer, doing this as a hobby hoping my work will be of some use for my colleagues.
I suppose I could make time to study all these items, I don’t know if it’s worth the effort.
I use DISLIN. It’s OK for graphs but not for making a modern looking interface.
So perhaps I should give Qt a chance.
Any advice?
If you are not against using Python in between I would recommend you a slightly different strategy:
Use Fortran to create your application as a Dynamic shared library > Expose it on Python using numpy.ctypeslib, on the Fortran side you would have to declare your public procedures as bind(c) the input/output arguments of those procedures shall use iso_c_binding types declaration> use streamlit to create a pretty looking GUI using Python. It is also Web based but can run locally or as sever, up to you.
Actually, for an all-Fortran solution, Gtk+ is still your best bet, since (like many other languages) Fortran’s FFI is only with C.
Having an operating system with a proper package manager could make things easier —e.g., installing Gtk+ in a Debian-derived machine is as easy as sudo apt install gtk-3-dev, even though it has layers upon layers of dependencies:
After 5 years of heavy use of WSL I can say that this is not a robust solution. I’ve come to understand that for Windows developers, WSL is just a facility tool to ensure that the code also works on linux, but by no means can it be seen as a replacement for native code, specially if one intends to give the application to others. So I would advise against any approach that only works on linux and that for Windows requires a WSL.
Using streamlit you avoid Qt, PyQt, C++ all together.
I don’t use Windows, so I have no idea how good a solution it is. I suggested it (with a question mark at the end), because it’s been on the news lately, after Microsoft open-sourced it.
The best way to see the WSL as of today is as very friendly virtual environment to ensure cross-platform development, but not as a replacement for native applications.
This is exactly the interface I’m looking for. I considered QuickWin too but it is, in my opinion, very poorly documented. Could you give me some clues to get started?
Of course, Intel Fortran offers QuickWin only under Windows. But it is possible to make such programs run in Linux using the WineHQ “emulator” (Well, Wine Is Not an Emulator ).
Your example could be implemented using Silverfrost FTN95’s native Clearwin+ library. I don’t see anything in your example that’s beyond Clearwin+. Fields to enter parameters, buttons to do calculations, simple graph plotting etc, are all possible.
This was the reason i adopted FTN95 as my preferred fortran compiler about 12 years ago. I am an almost retired electrical engineer, regularly modernising my old F77 codes for the next generation of engineers.
hkvzjal’s suggestion to use Python to provide the GUI and then call your own code (written in whatever language) is one of the things I’ve started doing myself.
The advantage with Python is that once you have your processed data in an array (numpy or otherwise) you can then export it with modules such as drawSVG (for importing SVG directly into desktop editing tools; Word / LibreOffice etc) and such as ezdxf for export to R12 era DXF (so everyone in the world can read it).
Hope this gives you another rabbit hole to go down.
Thank you all for your expert advice.
I tried most of the options with varying degrees of success.
Now I’m trying Microsoft’s MFC with Visual Studio. I know, it’s MS only, and I suppose many of you hate MS, but for now it’s all I need and it saves me a lot of C++ programming.
I’m not very proficient in C++ programming, and I don’t like it much (too many curly brackets and semi-colons