Topic: SF-Linux GUI, to run in a Window with no console appearing

I have looked at building a GUI usingGlade and Gtk but I'm not keen on that because I want to be able to code all my  GUI and other graphics into the object code, and I'm unkeen on the idea of my projects always having to include a separate Glade output file to sit alongside the program executable.

In case you come up with any ideas that you could use to post APpgraphics to Linux, Jeff, please mention this, but I realise that this is is very unlikely to be  on the cards for SF Linux, and I am assuming it will not be.  I must therefore revert to DISLIN, with which I know from experienece I can build a good GUI and which has versions that can be used with all Linux distros - including the RaspPi. 

I've a long way to go before I get there but I am therefore planning to install DISLIN for Linux, with which to create GUIs with SF-Linux.

A question for later, therefore, is this:  In the Windows version, there is a option to build a SF project executable that will run in its own Window, without opening a console.  Can this be done in the Linux version as well?

Re: SF-Linux GUI, to run in a Window with no console appearing


The problem of opening a console (vs. not) on Linux really isn't an issue.  On Windows, there are, and I'm generalizing quite a bit, two types of executables - console and GUI.  A GUI executable simply does not request handles to standard input, output, and error "handles" when starting up.  Normally, any program will in fact just start and assume it has access to standard i/o, causing windows to allocate a new console for the process.  By specifying the "-mwindows" flag in our compiler, we never request access to those handles, in a manner of speaking.  There are obviously technicalities and I've simplified the problem considerably, but one should get the idea.

On Linux, every program has access to a standard input and output.  The difference is that, on Linux, you generally don't see them if launched from a GUI element.  For an example, open a terminal and launch a program manually, such as simplyfortran.  Generally you won't see many messages if you're on Debian, but you might see a bunch of GTK warnings go by on Ubuntu.  Simply Fortran itself actually prints out a message when closing ("Shutdown complete") if launched from a terminal  When it runs from a menu, the Linux desktop doesn't necessarily open a console to display the program's standard output and error streams.

Simply Fortran for GNU/Linux always opens a console for every program it launches.  If we did provide the option to run as a GUI program, it would be somewhat misleading since it isn't actually changing anything in your executable; rather, it would just not show the console.  If you were to launch your executable from your prefered desktop, possibly by double-clicking in a file manager, you shouldn't see a console open at all.  I guess I do see the value in providing the option, but it isn't the same as what occurs in Windows.

Jeff Armstrong
Approximatrix, LLC