Using a graphical input system for a desing tool developed in Fortran.

I am developing an electronic device design tool using a Fortran compiler. I want to be able to display a graphics that shows the actual geometry of the device. I would like to have the display using generic names for the device structure such as l(ength), w(idth), and t(hicknes). When the user selects a generic name , a window pops up and the user can enter an actual value for that parameter. Also, individual layers represent a specific semiconductor. Again, when the user selects the generic name, say semiconductor 1, a pop-up window allows the user to enter the actual chemical name such as Si or GaAs

Is any of this possible or is it just a pipe dream? Is there a way of importing a package to do the above but not written in Fortran?

Thanks for any advice.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Pgplot/pgxtal, but ...

Pgxtal (http://epubs.cclrc.ac.uk/bitstream/1347/RAL-TR-97-060.pdf) provides some graphics output capability for Fortran based on PGplot, but I don't know whether it also supports input (such as selecting something with the mouse). However, programming a GUI in Fortran this way will for sure be an extreme pain in the neck, and most likely not be very portable.

I think you'd be much better off by wrapping your Fortran code into a library, and use some modern toolkit to program the GUI. The choice of the toolkit largely depends on which OSes you are targeting and what your language preferences (apart from Fortran) are - choices are almost infinite today. When it comes to wrapping scientific Fortran code, Python + Qt immediately spring to my mind, but it is hard to give recommendations without knowing your specific requirements.

steja, Thanks for the note.

steja,

Thanks for the note. I will porting this tool to 1) Windows XP & 7 and 2) Mac OS 10.5.8 & 10.6.2. Right now I am developing the software on a quad mac Pro running OS 10.5.8. I would be grateful for any suggestions for tool kits for either Mac and/or Windows OS'.

Thanks

GUI toolkits

OK - it still depends on your language preference: If you prefer Java than you could code your GUI in SWIG or SWT, and call your Fortran code (or, most likely, a C wrapper around it) through the Java Native Interface (JNI). I have to say that I am not an expert on this - I tried it once, but eventually gave up on the JNI stuff (this is not to say that JNI is bad, I just felt it was a little too complex for the simple thing I was trying to accomplish).

Personally, I use C++ and the Qt toolkit for most of my GUI stuff, and I'm pretty satisfied with it. In my case, this was a natural decision because I am doing all of my numerical development in C++ these days, so my Fortran code from the medieval times had gotten wrapped up in C++ anyways.

Qt also has bindings for Python (they are called PyQt4) - I tried them on a few occasions recently and it instantly worked extremely well. So if you already have some expericence with Python, you might give PyQt a try. There's also Python's "native" way to GUIs, TkInter: it is fairly limited and the GUIs look rather old-fashioned, but if you are aiming for something simple, it could be an option.

Of course, there are tons of other options (WxWindows for instance), but these are the ones I've used so far. I'd actually be interested what others are using - so, anybody else?

Another important point you should consider is licensing: I don't know whether you are planning to release your code under an open-source license, or on a commercial basis. Qt, for instance, is available under GPL and LGPL for open source projects, but to develop commercial software, you need to buy a commercial license.

Thanks for the advice,

Thanks for the advice, steja. At 76 and one of the first users of FORTRAN in scientific programming, I am not sure this old dog can learn new tricks! Of course I am always being accused , especially, by the engineers in my family of being an "old fogie".

I think I bit off more than I can chew here so I will probably set up a simple input procedure to handle the input problem.