<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — GUI I/O in FORTRAN programs]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=207&amp;type=atom" />
	<updated>2013-06-02T22:40:33Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=207</id>
		<entry>
			<title type="html"><![CDATA[Re: GUI I/O in FORTRAN programs]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=808#p808" />
			<content type="html"><![CDATA[<p>DISLIN is very easy to implement and works rather well, but the licensing is very restrictive.</p><p>QuickWin (Intel&#039;s GUI with their Parallel Studio product) is really only for bare-minimum getting a non-command prompt GUI.&nbsp; It&#039;ll display text in a window, for the most part.</p><p>gtk-fortran and the highlevel container for it that is also available is pretty good.&nbsp; Implements GTK+.&nbsp; Harder than DISLIN but the license is GNU v3.</p><p>I&#039;ve actually started on a framework uses gtk-fortran and (hopefully) makes it really easy to create a GUI.&nbsp; Also has a bit of OpenMP in it, too.&nbsp; Here&#039;s a link:&nbsp; <a href="https://sourceforge.net/projects/fortran-forge/">https://sourceforge.net/projects/fortran-forge/</a></p><p>Its only at v0.1, so its not that great yet, but I&#039;m probably going to upload v0.2 tonight which will make it a little easier to use.</p><p>If you just want an example, use the Simply Fortran Package Manager to download the gtk-fortran package and then when you go to create a new project, choose the pre-made &quot;Gtk-Fortran Examples&quot; project.&nbsp; That will have a lot of examples for all the different ways to create a GUI.</p>]]></content>
			<author>
				<name><![CDATA[jshahbazi]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3441</uri>
			</author>
			<updated>2013-06-02T22:40:33Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=808#p808</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: GUI I/O in FORTRAN programs]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=804#p804" />
			<content type="html"><![CDATA[<p>Here&#039;s a complete example using Simply Fortran and the DISLIN extension:</p><br /><p>&nbsp; &nbsp; &nbsp; PROGRAM Roots<br />C&nbsp; &nbsp; &nbsp;-------------<br />C&nbsp; &nbsp; &nbsp;Example showing how to use DISLIN to greate a Fortran GUI<br />C&nbsp; &nbsp; &nbsp;Jmw<br />C&nbsp; &nbsp; &nbsp;30-03-2011<br />C&nbsp; &nbsp; &nbsp;The concept is to display a window, with buttons, menus, <br />C&nbsp; &nbsp; &nbsp;input (fields) and output panel(s), and simply wait for the user<br />C&nbsp; &nbsp; &nbsp;to do stuff.&nbsp; The user enters data in input fields <br />C&nbsp; &nbsp; &nbsp;then activates various parts of the program by clicking buttons<br />C&nbsp; &nbsp; &nbsp;or selecting actions from pull-down menus.<br />C&nbsp; &nbsp; &nbsp;Each part of the program is executed in a subroutine, which always<br />C&nbsp; &nbsp; &nbsp;returns control to the user in the main top window.<br />&nbsp; &nbsp; &nbsp; USE dislin<br />&nbsp; &nbsp; &nbsp; IMPLICIT NONE<br />&nbsp; &nbsp; &nbsp; CHARACTER*8 aValu<br />&nbsp; &nbsp; &nbsp; CHARACTER*5 Header<br />&nbsp; &nbsp; &nbsp; INTEGER ipMain,ipTopM,ipTopL,ipTopR,ipBtmM,idMActs,idSqre,idSqRt,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; idIN, idOUT, CALL1,CALL2,CALL3,CALL4,CALL5,CALL6, i<br />&nbsp; &nbsp; &nbsp; COMMON aValu, idIN, idOUT<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; EXTERNAL Square, SqRoot, CuRoot<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; aValu=&#039;&nbsp; &nbsp; &nbsp; &nbsp; &#039;<br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;DESIGN THE MAIN WINDOW LAYOUT<br />C&nbsp; &nbsp; &nbsp;Size, position and title<br />&nbsp; &nbsp; &nbsp; CALL SWGWTH(24) <br />&nbsp; &nbsp; &nbsp; CALL SWGSIZ(408,420)<br />&nbsp; &nbsp; &nbsp; CALL SWGPOS(425,225)<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; Header=&#039;ROOTS&#039;<br />&nbsp; &nbsp; &nbsp; Print*, Header<br />&nbsp; &nbsp; &nbsp; CALL SWGTIT(Header)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Define main window ipMain, stacked vertically<br />&nbsp; &nbsp; &nbsp; CALL WGINI(&#039;VERT&#039;,ipmain)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Divide the top area of ipMain, ipTopM, horizontally<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CALL WGBAS(ipMain,&#039;HORI&#039;,ipTopM)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />C&nbsp; &nbsp; &nbsp; &nbsp; Define the L and R vertical stacks in ipTopM<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CALL WGBAS(ipTopM,&#039;VERT&#039;,ipTopL)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CALL WGBAS(ipTopM,&#039;VERT&#039;,ipTopR)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />C&nbsp; &nbsp; &nbsp; &nbsp; Repeatedly redefine ipMain&#039;s bottom area until far enough down<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DO i=1,12<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CALL WGBAS(ipmain,&#039;HORI&#039;,ipBtmM)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END DO<br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;Menus<br />C&nbsp; &nbsp; &nbsp;New menu<br />&nbsp; &nbsp; &nbsp; CALL WGPOP(ipmain,&#039;Actions&#039;,idMActs)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp; &nbsp;Menu entries<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL WGAPP(idMActs,&#039;Square&#039;,CALL1)<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL1, SQUARE)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; CALL WGAPP(idMActs,&#039;SqRoot&#039;,CALL2)<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL2, SQROOT)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; CALL WGAPP(idMActs,&#039;CuRoot&#039;,CALL3)<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL3, CUROOT)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Help menu<br />&nbsp; &nbsp; &nbsp; CALL SWGHLP(&#039;Enter a numeric value then|&#039;//<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;click an action button, or|&#039;//<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;select a menu action.&#039;)<br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;Prompt, messages and data entry field - in the top area, LH stack<br />&nbsp; &nbsp; &nbsp; CALL WGLAB(ipTopL,&#039;Simple JMW Fortran GUI example&#039;,i)<br />&nbsp; &nbsp; &nbsp; CALL WGLTXT(ipTopL,&#039;Enter a value&#039;,aValu,48,idIN)<br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;Buttons - in the top area, RH stack<br />&nbsp; &nbsp; &nbsp; CALL WGPBUT(ipTopR,&#039;SQUARE&#039;,CALL4)<br />&nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL4, SQUARE)<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; CALL WGPBUT(ipTopR,&#039;SQROOT&#039;,CALL5)<br />&nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL5, SQROOT)<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; CALL WGPBUT(ipTopR,&#039;CuROOT&#039;,CALL6)<br />&nbsp; &nbsp; &nbsp; CALL SWGCBK(CALL6, CUROOT)<br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;Output panel - in the bottom area<br />&nbsp; &nbsp; &nbsp; CALL SWGWTH(52)&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; CALL WGSTXT(ipBtmM,14,999,idOUT) <br />C-----------------------------------------------------------------------<br />C&nbsp; &nbsp; &nbsp;Activate<br />&nbsp; &nbsp; &nbsp; CALL WGFIN<br />C-----------------------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; STOP<br />&nbsp; &nbsp; &nbsp; END<br />C-----------------------------------------------------------------------&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; SUBROUTINE SQUARE<br />&nbsp; &nbsp; &nbsp; USE dislin<br />&nbsp; &nbsp; &nbsp; IMPLICIT NONE<br />&nbsp; &nbsp; &nbsp; CHARACTER*8 aValu<br />&nbsp; &nbsp; &nbsp; CHARACTER*20 StringR<br />&nbsp; &nbsp; &nbsp; INTEGER idIN, idOUT<br />&nbsp; &nbsp; &nbsp; REAL Value<br />&nbsp; &nbsp; &nbsp; COMMON aValu, idIN, idOUT<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Read the keyboard input value from idIN<br />&nbsp; &nbsp; &nbsp; CALL GWGTXT(idIN,aValu)<br />&nbsp; &nbsp; &nbsp; CALL GWGFLT(idIN,Value)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Run this part of the program<br />C&nbsp; &nbsp; &nbsp;(It would normally contain a lot more than this)<br />&nbsp; &nbsp; &nbsp; CALL SWGTXT(idOUT,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TRIM(aVALU)//&#039; (squared) = &#039;//<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STRINGR(Value**2,&#039;(F8.3)&#039;))<br />&nbsp; &nbsp; &nbsp; RETURN<br />&nbsp; &nbsp; &nbsp; END<br />C-----------------------------------------------------------------------</p><br /><p>&nbsp; &nbsp; &nbsp; SUBROUTINE SQROOT<br />&nbsp; &nbsp; &nbsp; USE dislin<br />&nbsp; &nbsp; &nbsp; IMPLICIT NONE<br />&nbsp; &nbsp; &nbsp; CHARACTER*8 aValu<br />&nbsp; &nbsp; &nbsp; CHARACTER*20 StringR<br />&nbsp; &nbsp; &nbsp; INTEGER idIN, idOUT<br />&nbsp; &nbsp; &nbsp; REAL Value<br />&nbsp; &nbsp; &nbsp; COMMON aValu, idIN, idOUT<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Read the keyboard input value from idIN<br />&nbsp; &nbsp; &nbsp; CALL GWGTXT(idIN,aValu)<br />&nbsp; &nbsp; &nbsp; CALL GWGFLT(idIN,Value)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Run this part of the program<br />C&nbsp; &nbsp; &nbsp;(It would normally contain a lot more than this) <br />&nbsp; &nbsp; &nbsp; CALL SWGTXT(idOUT,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp;&#039;Square root (&#039;//TRIM(aVALU)//&#039;) = &#039;//<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; STRINGR(SQRT(Value),&#039;(F8.3)&#039;))<br />&nbsp; &nbsp; &nbsp; RETURN<br />&nbsp; &nbsp; &nbsp; END<br />C-----------------------------------------------------------------------</p><br /><p>&nbsp; &nbsp; &nbsp; SUBROUTINE CUROOT<br />&nbsp; &nbsp; &nbsp; USE dislin<br />&nbsp; &nbsp; &nbsp; IMPLICIT NONE<br />&nbsp; &nbsp; &nbsp; CHARACTER*8 aValu<br />&nbsp; &nbsp; &nbsp; CHARACTER*20 StringR<br />&nbsp; &nbsp; &nbsp; INTEGER idIN, idOUT<br />&nbsp; &nbsp; &nbsp; REAL Value<br />&nbsp; &nbsp; &nbsp; COMMON aValu, idIN, idOUT<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Read the keyboard input value from idIN<br />&nbsp; &nbsp; &nbsp; CALL GWGTXT(idIN,aValu)<br />&nbsp; &nbsp; &nbsp; CALL GWGFLT(idIN,Value)<br />&nbsp; &nbsp; &nbsp; <br />C&nbsp; &nbsp; &nbsp;Run this part of the program<br />C&nbsp; &nbsp; &nbsp;(It would normally contain a lot more than this)<br />&nbsp; &nbsp; &nbsp; CALL SWGTXT(idOUT,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp;&#039;Cube root (&#039;//TRIM(aVALU)//&#039;) = &#039;// <br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; STRINGR(10**(LOG10(Value)/3),&#039;(F8.3)&#039;))<br />&nbsp; &nbsp; &nbsp; RETURN<br />&nbsp; &nbsp; &nbsp; END<br />C-----------------------------------------------------------------------</p><br /><p>&nbsp; &nbsp; &nbsp; FUNCTION STRINGR(RValu,F)<br />C&nbsp; &nbsp; &nbsp;Returns real RValu as a string<br />C&nbsp; &nbsp; &nbsp;F is the format specification, such as &#039;(F8.3)&#039;<br />&nbsp; &nbsp; &nbsp; Character STRINGR*20, F*80<br />&nbsp; &nbsp; &nbsp; REAL RValu<br />&nbsp; &nbsp; &nbsp; WRITE(STRINGR,F) RValu<br />&nbsp; &nbsp; &nbsp; RETURN<br />&nbsp; &nbsp; &nbsp; END<br />C-----------------------------------------------------------------------</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2013-06-02T16:33:34Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=804#p804</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[GUI I/O in FORTRAN programs]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=803#p803" />
			<content type="html"><![CDATA[<p>Here are the various alternative methods I have come across for developing FORTRAN software with a graphical user interface (&#039;GUI&#039;):</p><p>1.&nbsp; Use FORTRAN for the main algorithm, and wrap it in a JAVA code for the GUI.<br />&nbsp; &nbsp; &nbsp;Simply Fortran will presumably do this.<br />&nbsp; &nbsp; &nbsp;I don&#039;t know how to do it.<br />&nbsp; &nbsp; &nbsp;Does Simply Fortran support JAVA by any chance?<br />&nbsp; &nbsp; &nbsp;Can anyone supply a fully-coded example, with instructions for how to build it <br />&nbsp; &nbsp; &nbsp;into an executable which will run under Win Doze?</p><p>2.&nbsp; Use FORTRAN for the main algorithm, and wrap it in a Python code for the GUI.<br />&nbsp; &nbsp; &nbsp;Simply Fortran will presumably do this.<br />&nbsp; &nbsp; &nbsp;I don&#039;t know how to do it.<br />&nbsp; &nbsp; &nbsp;Does Simply Fortran support Python by any chance?<br />&nbsp; &nbsp; &nbsp;Can anyone supply a fully-coded example, with instructions for how to build it <br />&nbsp; &nbsp; &nbsp;into an executable which will run under Win Doze?</p><p>3.&nbsp; Use Compaq Visual Fortran and its GUI tools, if you still use WinXP 32 bit.<br />&nbsp; &nbsp; &nbsp;CVF6.6f is not installable/runnable under Win Doze 7 64 bit.</p><p>4.&nbsp; Use the Intel FORTRAN derivative of CVF, with its GUI tools.<br />&nbsp; &nbsp; &nbsp;If you can afford to spend several hundred quid on it.</p><p>5.&nbsp; Use Salford university&#039;s product, &#039;Silverfrost&#039; FORTRAN, <br />&nbsp; &nbsp; &nbsp;with its &#039;ClearWin+&#039; GUI tools.<br />&nbsp; &nbsp; &nbsp;I&#039;m not sure but I have a feeling that the free version has some kind<br />&nbsp; &nbsp; &nbsp;of restriction, such as an advertising banner in all output.<br />&nbsp; &nbsp; &nbsp;Does anyone know for sure what the score is with this?</p><p>6.&nbsp; Use the commercial version of Salford university&#039;s &#039;Silverfrost&#039; <br />&nbsp; &nbsp; &nbsp;FORTRAN, with its &#039;ClearWin+&#039; GUI tools.<br />&nbsp; &nbsp; &nbsp;If you can afford to spend several hundred quid on it</p><p>7.&nbsp; Use Simply Fortran with the DISLIN extension.<br />&nbsp; &nbsp; &nbsp;This works brilliantly, and is not difficult.<br />&nbsp; &nbsp; &nbsp;I taught myself to do it, after reading a paper by Clive Page.<br />&nbsp; &nbsp; &nbsp;Easy to find on the web.<br />&nbsp; &nbsp; &nbsp;I will post a complete example immediately after posting this message.</p><p>8.&nbsp; Use Simply Fortran with the Gtk Fortran extension.<br />&nbsp; &nbsp; &nbsp;I&#039;ve not tried this but it looks do-able.<br />&nbsp; &nbsp; &nbsp;I read somewhere that Gtk Fortran can be a bit tricky.<br />&nbsp; &nbsp; &nbsp;Can anyone amplify, confirm or correct this?<br />&nbsp; &nbsp; &nbsp;Can anyone supply a fully-coded example, with instructions for how to build it <br />&nbsp; &nbsp; &nbsp;into an executable which will run under Win Doze?<br />----<br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2013-06-02T16:27:13Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=803#p803</id>
		</entry>
</feed>
