<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Issue appgrafics]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=812</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=812&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Issue appgrafics.]]></description>
		<lastBuildDate>Fri, 11 Jun 2021 09:55:32 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3758#p3758</link>
			<description><![CDATA[<p>Hi Jeff,<br />It works great now. Thank you very much!!<br />I must say this compiler is great! I had a look at several Fortran compilers, but this one is for me the best there is!!</p><p>I would like to show you what I created with this compiler, but unfortunately this is not possible.</p><p>Thanks again for your great support!!!</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Fri, 11 Jun 2021 09:55:32 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3758#p3758</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3757#p3757</link>
			<description><![CDATA[<p>The problem is that you need to define a true interface to your <em>noclosewin</em> function.&nbsp; I see that you have it on the integer declaration line, but that isn&#039;t sufficient.&nbsp; If you&#039;re using Fortran 90 modules, it would be easy to scope, but I suspect you are not.</p><p>A solution that might seem ugly now is to change your calling function to be:</p><div class="codebox"><pre><code>      subroutine GRAF()
.
      use appgraphics
      implicit none
.
.
      integer:: ipixxx, ipixyy, winx, winy, iiwin
      character::(20) mnubuf

      interface
            function noclosewin()
            integer::noclosewin
            end function noclosewin
      end interface

.
.
.
      iiwin = initwindow(ipixxx,ipixyy,mnubuf,winx,winy,dbflag=.false.,closeflag=.false.)
.
.
      call setwindowsystemclosecallback(noclosewin)
.
.
      end subroutine GRAF</code></pre></div><p>The above should now make it clear to the compiler that <em>noclosewin</em>, wherever it is in your code, is a function returning an integer.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 10 Jun 2021 19:24:39 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3757#p3757</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3756#p3756</link>
			<description><![CDATA[<p>To do a simple test I kept it simple and created almost exactly the same function as You did! Only the &quot;print&quot; statement is not in there.<br />&nbsp; &nbsp; &nbsp; function noclosewin()<br />!<br />&nbsp; &nbsp; &nbsp; implicit none<br />!<br />!&nbsp; &nbsp; &nbsp; procedure als window wordt geclosed<br />!<br />!<br />&nbsp; &nbsp; &nbsp; INTEGER::noclosewin<br />!<br />&nbsp; &nbsp; &nbsp; noclosewin = 0<br />!<br />&nbsp; &nbsp; &nbsp; return<br />!<br />&nbsp; &nbsp; &nbsp; END function noclosewin</p><p>But I don&#039;t think the function is the issue.<br />The main source holding the call to the new subroutine gives the error!</p><p>The following lines are amongst others in my mainsource:</p><p>&nbsp; &nbsp; &nbsp; subroutine GRAF()<br />.<br />&nbsp; &nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; &nbsp; implicit none<br />.<br />.<br />&nbsp; &nbsp; &nbsp; integer:: noclosewin, ipixxx, ipixyy, winx, winy, iiwin<br />&nbsp; &nbsp; &nbsp; character::(20) mnubuf<br />.<br />.<br />.<br />&nbsp; &nbsp; &nbsp; iiwin = initwindow(ipixxx,ipixyy,mnubuf,winx,winy,dbflag=.false.,closeflag=.false.)<br />.<br />.<br />&nbsp; &nbsp; &nbsp; call setwindowsystemclosecallback(noclosewin)<br />(here the editor presents the error-message!!!)<br />.<br />.<br />&nbsp; &nbsp; &nbsp; end subroutine GRAF</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Thu, 10 Jun 2021 17:16:11 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3756#p3756</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3755#p3755</link>
			<description><![CDATA[<p>What does the function <em>noclosewin</em> look like?&nbsp; Can you post it?&nbsp; It should be something like:</p><div class="codebox"><pre><code>    function noclosewin ()
    implicit none
    integer::noclosewin 
    
        noclosewin = 0
        Print *, &quot;I blocked it&quot;
        
    end function noclosewin </code></pre></div><p>I tried the above on my system with the latest build, and it seemed to work.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 10 Jun 2021 11:49:14 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3755#p3755</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3754#p3754</link>
			<description><![CDATA[<p>Hi Jeff,<br />If I remove the parentheses as you mention I get the same error when trying to compile the source!<br />I enabled the visibility of warnings in the editor. And the editor already shows the mentioned error before I even can start the compiler.</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Wed, 09 Jun 2021 17:27:15 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3754#p3754</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3753#p3753</link>
			<description><![CDATA[<p>You need to pass the function itself, not call the function.&nbsp; You actually want to write:</p><div class="codebox"><pre><code>              call setwindowsystemclosecallback( noclosewin )</code></pre></div><p>By removing the parentheses, you&#039;re passing the function itself, not the result of calling the function, which is what your original code was doing.</p><p>Does that make sense?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 08 Jun 2021 18:40:45 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3753#p3753</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3752#p3752</link>
			<description><![CDATA[<p>Hi Jeff,<br />First of all thanks for the new update version 3.19<br />I&#039;m trying to use the new &quot;setwindowsystemclosecallback&quot; routine<br />As described in the documentation, I created a callback-Function and after creating a window, I added the following line to my fortran source:&nbsp; &nbsp; &nbsp; &nbsp;call setwindowsystemclosecallback( noclosewin() )<br />Noclosewin() is the function I created and compiles without any errors!<br />When I then try to compile the main-source I get an error at the line with the call to the new subroutine as mentioned above:<br />&nbsp; &nbsp; Error: Expected a procedure for argument &#039;f&#039; at (1)</p><p>I defined noclosewin as &quot;integer&quot;<br />Am I doing something wrong?</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Tue, 08 Jun 2021 14:28:49 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3752#p3752</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3744#p3744</link>
			<description><![CDATA[<p>Hi Jeff,<br />Thanks for your reply. If you could add a API to block it I would be very happy.<br />I think it was in SF version 2 that it worked the way I described.<br />Again, thanks very much for your support!!</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Wed, 12 May 2021 10:35:52 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3744#p3744</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3743#p3743</link>
			<description><![CDATA[<p>John,</p><p>I see what you&#039;re asking now.&nbsp; You want to disable the Windows &quot;close&quot; button?&nbsp; If that ever did work in AppGraphics, it was a bug.&nbsp; The <em>closeflag</em> only means that the program won&#039;t terminate, not that the window won&#039;t close.&nbsp; If you click the close button, the window and its resources will be destroyed, but the program will keep running.</p><p>Overriding Windows&#039; <em>WM_CLOSE</em> is going to be messy.&nbsp; I would have to add a new API to block it.&nbsp; The better way to handle this would be to assign a callback using <em>setwindowclosecallback</em> that will trigger safe shutdown in the main thread.&nbsp; I&#039;ll see about cancelling the <em>WM_CLOSE</em> message, though.&nbsp; It will take a bit of time to add.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 11 May 2021 19:05:35 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3743#p3743</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3742#p3742</link>
			<description><![CDATA[<p>Jeff, I think I don&#039;t understand what you are saying.<br />In a previous version of SF, when I clicked the red window cross, nothing happened, and that is exactly what I want!<br />So, I don&#039;t want the window to be closed! Again, in a previous version it worked that way.<br />I have created an &quot;escape&quot;-button in my app, that the user must use, or click the &quot;escape&quot;-key to close the app and not the windows cross-button.<br /> So, I am wondering way this doesn&#039;t work any more.</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Tue, 11 May 2021 15:06:55 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3742#p3742</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3741#p3741</link>
			<description><![CDATA[<p>The issue in the example is that you&#039;re checking for keys pressed after the window is closed.&nbsp; The keyboard routines are tied to an AppGraphics window.&nbsp; The call to <em>kbhit</em> after the window closes causes an exception because a non-existent window keyboard queue is queried.</p><p>It probably shouldn&#039;t outright crash, though it might be hard to modify the library to avoid that.&nbsp; However, the fix would simply cause <em>kbhit</em> to return <em>.FALSE.</em>, leaving this example in an infinite loop.</p><p>Basically, if all the AppGraphics windows are closed, it is extremely dangerous to continue making calls to the library.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 11 May 2021 12:51:21 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3741#p3741</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3740#p3740</link>
			<description><![CDATA[<p>Hi Jeff,<br />As promised I send you a simple source. When running the executable the app creates a window and waits for a key to be pressed.<br />When the key is pressed the app will close without any issue.<br />When closing the app by hitting the red close-button of the window I get the mentioned error!</p><p>&nbsp; &nbsp; &nbsp; Program test<br />!<br />&nbsp; &nbsp; &nbsp; use appgraphics<br />!<br />&nbsp; &nbsp; &nbsp; implicit none<br />!<br />&nbsp; &nbsp; &nbsp; INTEGER ipixxx, ipixyy, maxpx, maxpy, winx, winy, iiwin, ic<br />&nbsp; &nbsp; &nbsp; INTEGER*2 port, imode, ipixelx, ipixely<br />&nbsp; &nbsp; &nbsp; CHARACTER*6 mnubuf<br />&nbsp; &nbsp; &nbsp; logical keypressed<br />!<br />&nbsp; &nbsp; &nbsp; maxpy = getmaxheight()<br />&nbsp; &nbsp; &nbsp; maxpx = getmaxwidth()<br />&nbsp; &nbsp; &nbsp; port = 38<br />&nbsp; &nbsp; &nbsp; imode = 180<br />&nbsp; &nbsp; &nbsp; if (maxpx .gt. 1500) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ipixely = ((int2(maxpy)-int2(150)) / port) * port<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ipixelx = ((int2(maxpx)-int2(50)) / imode) * imode<br />&nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ipixely = ((int2(maxpy)-int2(30)) / port) * port<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ipixelx = ((int2(maxpx)-int2(5)) / imode) * imode<br />&nbsp; &nbsp; &nbsp; end if<br />!<br />&nbsp; &nbsp; &nbsp; winx = (maxpx - ipixelx) / 2<br />&nbsp; &nbsp; &nbsp; winy = (maxpy - ipixely) / 3<br />&nbsp; &nbsp; &nbsp; ipixxx = ipixelx<br />&nbsp; &nbsp; &nbsp; ipixyy = ipixely<br />!&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; mnubuf = &#039;Dynrel&#039;<br />&nbsp; &nbsp; &nbsp; iiwin = initwindow(ipixxx,ipixyy,mnubuf,winx,winy,dbflag=.false.,<br />&nbsp; &nbsp; &nbsp;+&nbsp; &nbsp; &nbsp; &nbsp; closeflag=.FALSE.)<br />!<br />450&nbsp; &nbsp;Keypressed = .FALSE.<br />&nbsp; &nbsp; &nbsp; Keypressed = kbhit()<br />&nbsp; &nbsp; &nbsp; IF (Keypressed) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Ic = getch()<br />&nbsp; &nbsp; &nbsp; end if<br />&nbsp; &nbsp; &nbsp; IF (Ic .LE. 0) GOTO 450<br />!<br />&nbsp; &nbsp; &nbsp; stop<br />!<br />&nbsp; &nbsp; &nbsp; END program test</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Mon, 10 May 2021 17:59:01 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3740#p3740</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3739#p3739</link>
			<description><![CDATA[<p>I will set up a source and send it to you!</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Mon, 10 May 2021 17:44:25 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3739#p3739</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3738#p3738</link>
			<description><![CDATA[<p>Sorry Jeff,<br />I stated that &quot;dbflag&quot; is not working but I mend &quot;closeflag&quot;</p>]]></description>
			<author><![CDATA[null@example.com (john_p)]]></author>
			<pubDate>Mon, 10 May 2021 17:42:53 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3738#p3738</guid>
		</item>
		<item>
			<title><![CDATA[Re: Issue appgrafics]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=3734#p3734</link>
			<description><![CDATA[<p>John,</p><p>I can&#039;t replicate this behavior.&nbsp; Do you have a simple code sample that causes this crash?</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Fri, 07 May 2021 13:43:08 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=3734#p3734</guid>
		</item>
	</channel>
</rss>
