Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GUI solution for Fortran 1

Status
Not open for further replies.

JasonLe

Programmer
Feb 10, 2014
1
AU
Hi everyone,
This maybe a dumb question but i'm new to Fortran. I have this project at uni and i'm required to write a fortran program to analyze the deflection of a steel member. Is there any way I can make a graphical user interface in Fortran to input and output my data? For example, instead of typing in the coordinate of all the points in the steel member in the console windows, you can just use a mouse and plot them like in Autocad. Is Fortran capable of doing that?
Thanks
 
They are many solutions (but graphics are never easy) :
- I use the system of my compagny (ODESSA) which is not free...
- you might use free libraries (or almost free) like JAPI (I still use it from time to time) or DSLIN for instance.
- it is also possible to manage GUI externally using TCL-TK or Python for instance,
- it exists Fortran bindings to general graphical libraries like X11 (on Unix), GTK (Unix and Windows) but developing a GUI from scratch is complicated
- it often exists also graphical libraries associated to specific Fortran compilers
- at last, the best solutions are not free (Winteracter, GINO, MATFOR ...)

François Jacq
 
That's not a Fortran project, anymore.

Do you know how many lines of Fortran is takes to do what the prof asked you? (Hint: < 20)

Do you know how many to do what you are thinking?

The non-gui standard way of doing things is to have a data file of known format and meaning, read the data, solve the problem and write out the solution.

In you case, your data file could contain pertinent data to your problem...beam cross sectional area, length, load, load location, young's modulus, etc...but you already knew this.

Do your homework, first; then, add your bells and whistles.



 
Faced with a similar problem, and having some proficiency in Excel, I made a pretty nifty interface in Excel. Among other things, Excel allows easy graphing and tabulating of computational results. It allows easy input of parameter values. Buttons can be created that link to Visual Basic code. You don't need to know much Visual Basic just to invoke an executable that was compiled from Fortran, read a file containing input parameters, write a file of output, or graphs results. Excel will communicate with the Fortran executable just via file easily read and written via in Basic. The design of the interface is done easily via point and click. You can format your screens to protect areas you don't want disturbed, make grid lines invisible, and otherwise decorate your GUI.
 
pjansson I am faced with the same problem of graphing my fortran results. you have done it using excel. I don't have this much proficiency in excel can yhou tell me where to get some tutorials about this?
Thanks
 
The Excel approach to a GUI is easiest for users who already have experience using it as a spreadsheet because there is a "learning curve." Excel is probably the most widely used spreadsheet application for PC, Mac, etc. and is a product of Microsoft, part of the Office suite of applications. Because spread sheets are so powerful for interaction with data without explicitly writing computer code, learning Excel is an investment that can pay off in many ways. Using it as a GUI is just one example that I discovered. Perhaps not too many people have used it this way. Many paperback books that introduce Excel are available in bookstores and online. Other spreadsheet programs are available that might have similar capability, but I am not familiar with them.
 
Start by printing your results in a CSV file i.e. there are commas between the numbers and give the output file a .csv extension. Excel will pick these up readily.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top