<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — AppGraphics and Multiple Windows]]></title>
	<link rel="self" href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=476&amp;type=atom" />
	<updated>2016-02-19T13:58:57Z</updated>
	<generator>PunBB</generator>
	<id>http://forums.approximatrix.com/viewtopic.php?id=476</id>
		<entry>
			<title type="html"><![CDATA[Re: AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2377#p2377" />
			<content type="html"><![CDATA[<p>Tommy,</p><p>You can set the window&#039;s background color using <em>setbkcolor</em> followed by a call to <em>clearviewport</em>.</p><p>You can&#039;t, at this time, control the color of Windows controls (buttons, text boxes, etc.) at all.&nbsp; They will always draw according to the Windows system theme.</p><p>I&#039;m not sure if you have a question about <em>createtextbox</em>.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2016-02-19T13:58:57Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2377#p2377</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2374#p2374" />
			<content type="html"><![CDATA[<p>Jeff,<br /> think I got past the button problem. I cannot control the background color of the window that&#039;s created. I drew a box over the entire window and I can control the color etc. Just does not seem right. Also, I have not found way to control color of buttons. </p><p>Trying to create edit box i.e. createtextbox. seems it&#039;s not there.</p><p>THX<br />Tommy</p>]]></content>
			<author>
				<name><![CDATA[tklfranklin]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3663</uri>
			</author>
			<updated>2016-02-18T18:04:30Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2374#p2374</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2372#p2372" />
			<content type="html"><![CDATA[<p>Comment: In MATLAB with same situation - used &quot;hold on&quot;. If loop() does it here I&#039;m not sure how it works. Thx for looking!<br />program test<br />!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />! program resizing<br />use appgraphics<br />implicit none</p><p>&nbsp; &nbsp; integer::myscreen<br />&nbsp; &nbsp; integer::mybutton<br />&nbsp; &nbsp; integer::mybutton1<br />&nbsp; &nbsp; integer::mybutton2<br />&nbsp; &nbsp; integer::mybutton3<br />&nbsp; &nbsp; integer::mybutton4<br />&nbsp; &nbsp; integer, volatile::task</p><p>&nbsp; &nbsp; integer, parameter::task_quit=0<br />&nbsp; &nbsp; integer, parameter::task_open=1<br />&nbsp; &nbsp; integer, parameter::task_run=2<br />&nbsp; &nbsp; integer::run_item</p><p>&nbsp; &nbsp; !--------------Added-------------------------------------\/<br />&nbsp; &nbsp; integer, parameter::task_win=3<br />&nbsp; &nbsp; integer, parameter::task_close=4<br />&nbsp; &nbsp; integer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:: root_menu, file_menu, item_temp, win_menu, itr <br />&nbsp; &nbsp; integer&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::&nbsp; file_menu1, file_menu2 <br />&nbsp; &nbsp; character(2)&nbsp; &nbsp; :: CRLF, title<br />&nbsp; &nbsp; character(512)&nbsp; :: cTxt<br />&nbsp; &nbsp; logical&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:: bClose<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; integer, dimension(256)::child_windows</p><p>&nbsp; &nbsp; !--- CRLF = C_CARRIAGE_RETURN // C_NEW_LINE<br />&nbsp; &nbsp; CRLF = Achar(13) // Achar(10)<br />&nbsp; &nbsp; !--------------------------------------------------------/\<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; child_windows = -1<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; myscreen = initwindow(820, 940, closeflag=.FALSE.)</p><p>&nbsp; &nbsp; !&nbsp; &nbsp; myscreen = initwindow(400, 100, title=title, dbflag=.FALSE., closeflag=.FALSE.)<br />&nbsp; &nbsp; &nbsp; &nbsp; call setbkcolor(systemcolor(COLOR_WINDOW_BKGD))<br />&nbsp; &nbsp; &nbsp; &nbsp; call setcolor(BLACK)<br />&nbsp; &nbsp; &nbsp; &nbsp; call settextstyle(WINDOWS_FONT, HORIZ_DIR, 10)<br />&nbsp; &nbsp; &nbsp; &nbsp; call setfillstyle(SOLID_FILL, RED)</p><p>&nbsp; &nbsp; root_menu = addmenu(&quot;&quot;, MENU_FOR_WINDOW)</p><p>&nbsp; &nbsp; file_menu = addmenu(&quot;File&quot;, root_menu);</p><p>&nbsp; &nbsp; file_menu1 = addmenu(&quot;Last Seven Days&quot;, root_menu);</p><p>&nbsp; &nbsp; file_menu2 = addmenu(&quot;Last Eight Days&quot;, root_menu);</p><p>&nbsp; &nbsp; item_temp = addmenuitem(&quot;Open another window...&quot;, file_menu, handle_winopen)<br />&nbsp; &nbsp; item_temp = addmenuitem(&quot;Close a window...&quot;, file_menu, handle_winclose)<br />&nbsp; &nbsp; item_temp = addmenuitem(&quot;Save Screenshot...&quot;, file_menu, savescreen)<br />&nbsp; &nbsp; item_temp = addmenuitem(&quot;Open&quot;, file_menu, handle_open)<br />&nbsp; &nbsp; run_item = addmenuitem(&quot;Run&quot;, file_menu, handle_run)<br />&nbsp; &nbsp; item_temp = addmenuitem(&quot;Quit&quot;, file_menu, quitwndo)</p><p>&nbsp; &nbsp; call setfillstyle(SOLID_FILL, WHITE);<br />&nbsp; &nbsp; call bar(0, 0, 820, 940);<br />&nbsp; &nbsp;<br />&nbsp; &nbsp; mybutton1 = createbutton(70, 410, 120, 120, &quot;Off Duty&quot;, handle_button1)<br />&nbsp; &nbsp; mybutton2 = createbutton(270, 410, 120, 120, &quot;Sleeper&quot;, handle_button2)<br />&nbsp; &nbsp; mybutton = createbutton(470, 410, 120, 120, &quot;Driving&quot;, handle_button3)<br />&nbsp; &nbsp; mybutton = createbutton(670, 410, 120, 120, &quot;On Duty &quot;, handle_button4)</p><p>&nbsp; &nbsp; do while(task .NE. task_quit)<br />&nbsp; &nbsp; &nbsp; &nbsp; call draw_window()&nbsp; &nbsp; !&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; draw_window<br />&nbsp; &nbsp; &nbsp; &nbsp; task = -1<br />&nbsp; &nbsp; &nbsp; &nbsp; call loop()<br />&nbsp; &nbsp; &nbsp; &nbsp; select case(task)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case (task_open)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call openfile()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case (task_run)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call longrun()<br />&nbsp; &nbsp; !--------------Added-------------------------------------\/<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case (task_win)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; itr = itr + 1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call openwin()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case (task_close)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call closewin()<br />&nbsp; &nbsp; !--------------------------------------------------------/\<br />&nbsp; &nbsp; &nbsp; &nbsp; end select</p><p>&nbsp; &nbsp; end do</p><p>&nbsp; !&nbsp; call closewindow(myscreen)</p><p>&nbsp; &nbsp; CONTAINS !--- SUBROUTINES</p><br /><br /><p>&nbsp; &nbsp; subroutine draw_window()<br />&nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; &nbsp; &nbsp; integer::w,h</p><p>&nbsp; &nbsp; &nbsp; &nbsp; integer::tw<br />&nbsp; &nbsp; &nbsp; &nbsp; character(100)::info<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; call setcurrentwindow(myscreen)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; w = getmaxx()<br />&nbsp; &nbsp; &nbsp; &nbsp; h = getmaxy()</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call setbuttonposition(mybutton, w-50, h-30, 40, 20)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; write(info, &#039;(A5,1X,I5,A1,I5)&#039;) &quot;Size:&quot;, w, &quot;x&quot;, h</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call setviewport(0, 0, w, 40, .FALSE.)<br />&nbsp; &nbsp; &nbsp; &nbsp; call clearviewport()<br />&nbsp; &nbsp; &nbsp; &nbsp; tw = textwidth(trim(info))<br />&nbsp; &nbsp; &nbsp; &nbsp; call outtextxy( (w/2-tw/2), 5, trim(info))</p><p>&nbsp; &nbsp; end subroutine draw_window</p><p>&nbsp; &nbsp; subroutine handle_button1()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; end subroutine handle_button1</p><p>&nbsp; &nbsp; &nbsp;subroutine handle_button2()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; end subroutine handle_button2</p> <br /><p>&nbsp; &nbsp; &nbsp;subroutine handle_button3()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_button3<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;subroutine handle_button4()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_button4</p><p> subroutine handle_resize()<br />&nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_resize</p><p>&nbsp; &nbsp; subroutine handle_open()<br />&nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_open<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_open</p><p>&nbsp; &nbsp; !--------------Added-------------------------------------\/<br />&nbsp; &nbsp; subroutine handle_winopen()<br />&nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_win<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_winopen</p><p>&nbsp; &nbsp; subroutine openwin()<br />&nbsp; &nbsp; &nbsp; &nbsp; USE appgraphics<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; &nbsp; &nbsp; character(4) :: cItr</p><p>&nbsp; &nbsp; &nbsp; &nbsp; write( cItr, &#039;(I3)&#039; ) Itr<br />&nbsp; &nbsp; &nbsp; &nbsp; cTxt =&nbsp; &#039;Open window number &#039;// cItr //CRLF// &amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;with the closeflag = .FALSE.&nbsp; Let&#039;&#039;s try and &#039; //CRLF// &amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;select-&gt; FILE/CLOSE A WINDOW.&#039; //CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; bClose = .FALSE.<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL SplashScreen( &#039;New Window&#039;, cTxt, 3, bClose )</p><p>&nbsp; &nbsp; end subroutine openwin</p><p>&nbsp; &nbsp; subroutine handle_winclose()<br />&nbsp; &nbsp; use appgraphics<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_close<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_winclose</p><p>&nbsp; &nbsp; subroutine closewin()<br />&nbsp; &nbsp; &nbsp; &nbsp; USE appgraphics<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none<br />&nbsp; &nbsp; &nbsp; &nbsp; integer::i</p><p>&nbsp; &nbsp; &nbsp; &nbsp; !--- Close the windows<br />!&nbsp; &nbsp; &nbsp; &nbsp; CALL closewindow (ALL_WINDOWS)<br />!&nbsp; &nbsp; &nbsp; &nbsp; CALL closewindow (NO_CURRENT_WINDOW)<br />!&nbsp; &nbsp; &nbsp; &nbsp; CALL closewindow()</p><p>&nbsp; &nbsp; &nbsp; &nbsp; do i=1,ubound(child_windows, 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(child_windows(i) .GE. 0) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call closewindow(child_windows(i))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; child_windows(i) = -1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end if<br />&nbsp; &nbsp; &nbsp; &nbsp; end do<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; end subroutine closewin</p><p>&nbsp; &nbsp; subroutine openfile()<br />&nbsp; &nbsp; &nbsp; &nbsp; USE appgraphics, ONLY: dlgopenfile<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; CHARACTER(255)&nbsp; :: input_file_name</p><p>&nbsp; &nbsp; &nbsp; &nbsp; !&nbsp; &nbsp;Appgraphics function dlgopenfile (filename, maskdesc, mask, title)<br />&nbsp; &nbsp; &nbsp; &nbsp; input_file_name= repeat(&#039; &#039;, 255)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; IF( dlgopenfile( &amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; input_file_name, &#039;Data&#039;, &#039;*.raw&#039;, &#039;Enter data file&#039;) ) THEN</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Print *, &quot;You&#039;ve selected &quot;//trim(input_file_name)<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Print *, &quot;No file was selected&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; END IF</p><p>&nbsp; &nbsp; &nbsp; &nbsp; input_file_name = TRIM(input_file_name)</p><p>&nbsp; &nbsp; end subroutine openfile</p><p>&nbsp; &nbsp; subroutine savescreen()<br />&nbsp; &nbsp; &nbsp; &nbsp; use appgraphics, only: writeimagefile<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; ! This call will open a file dialog since we haven&#039;t<br />&nbsp; &nbsp; &nbsp; &nbsp; ! specified a filename<br />&nbsp; &nbsp; &nbsp; &nbsp; call writeimagefile()</p><p>&nbsp; &nbsp; end subroutine savescreen</p><p>&nbsp; &nbsp; subroutine handle_run()<br />&nbsp; &nbsp; &nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_run<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_run</p><p>&nbsp; &nbsp; subroutine longrun()<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; real::starttime, nowtime</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call enablemenuitem(run_item, .FALSE.)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call cpu_time(starttime)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nowtime = starttime<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do while(nowtime - starttime .LT. 0.01)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call cpu_time(nowtime)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WRITE( *,&#039;(A1$)&#039;) , &quot;.&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call enablemenuitem(run_item, .TRUE.)</p><p>&nbsp; &nbsp; end subroutine longrun</p><p>&nbsp; &nbsp; subroutine quitwndo()<br />&nbsp; &nbsp; &nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine quitwndo</p><p>&nbsp; &nbsp; !<br />&nbsp; &nbsp; !--------------------------------------------------------<br />&nbsp; &nbsp; Subroutine SplashScreen( cMenu, cTxt, nDelaysec, bClose )<br />&nbsp; &nbsp; ! Parameters:<br />&nbsp; &nbsp; !&nbsp; &nbsp;cMenu:&nbsp; &nbsp; &nbsp; text used in the menu title bar<br />&nbsp; &nbsp; !&nbsp; &nbsp;cTxt:&nbsp; &nbsp; &nbsp; &nbsp;text narrative in the textbox<br />&nbsp; &nbsp; !&nbsp; &nbsp;nDelaysec:&nbsp; number seconds delayed<br />&nbsp; &nbsp; &nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; character(*), intent(IN) :: cMenu<br />&nbsp; &nbsp; &nbsp; &nbsp; character(*), intent(IN) :: cTxt<br />&nbsp; &nbsp; &nbsp; &nbsp; integer, intent(IN)&nbsp; &nbsp; &nbsp; :: nDelaysec<br />&nbsp; &nbsp; &nbsp; &nbsp; logical, intent(IN)&nbsp; &nbsp; &nbsp; :: bClose</p><p>&nbsp; &nbsp; &nbsp; &nbsp; character(LEN(cTxt))&nbsp; &nbsp; &nbsp;:: cTxt2<br />&nbsp; &nbsp; &nbsp; &nbsp; character(2) :: CRLF<br />&nbsp; &nbsp; &nbsp; &nbsp; integer :: textbox, timerscreen, myscreen<br />&nbsp; &nbsp; &nbsp; &nbsp; integer :: tw, w, wd, h, ht, nlen<br />&nbsp; &nbsp; &nbsp; &nbsp; integer::i</p><p>&nbsp; &nbsp; &nbsp; &nbsp; !--- CRLF = C_CARRIAGE_RETURN // C_NEW_LINE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CRLF = Achar(13) // Achar(10)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; !--- Line width of text is 64 characters/line<br />&nbsp; &nbsp; &nbsp; &nbsp; nlen = LEN( TRIM(cTxt) )&nbsp; ! lenstr(s)<br />&nbsp; &nbsp; &nbsp; &nbsp; cTxt2 = cTxt(1:nlen)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; ht = 100<br />&nbsp; &nbsp; &nbsp; &nbsp; wd = 0</p><p>&nbsp; &nbsp; &nbsp; &nbsp; timerscreen = initwindow(400, ht, title=cMenu, &amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; left=300, top=200, closeflag=bClose)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; do i=1, ubound(child_windows, 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(child_windows(i) .EQ. -1) then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; child_windows(i) = timerscreen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end if<br />&nbsp; &nbsp; &nbsp; &nbsp; end do</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call setcolor(BLACK)<br />&nbsp; &nbsp; &nbsp; &nbsp; call setbkcolor(WHITE)<br />&nbsp; &nbsp; &nbsp; &nbsp; call clearviewport()</p><p>&nbsp; &nbsp; &nbsp; &nbsp; w = getmaxx()<br />&nbsp; &nbsp; &nbsp; &nbsp; h = getmaxy()</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call settextjustify(LEFT_TEXT, TOP_TEXT)<br />&nbsp; &nbsp; &nbsp; &nbsp; call settextstyle (SANS_SERIF_FONT, HORIZ_DIR, 16)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; tw = textwidth(TRIM(cTxt2))<br />&nbsp; &nbsp; &nbsp; &nbsp; cTxt2 = TRIM(cTxt2)<br />&nbsp; &nbsp; &nbsp; &nbsp; call outtextxy( (w/2-tw/2+wd), h/2-h/5, TRIM(cTxt2) )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call startidle (nDelaysec*1000)<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL stopidle( )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; call refreshall( )</p><p>&nbsp; &nbsp; &nbsp; &nbsp; !--- Set the main menu window to the current window<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL setcurrentwindow (myscreen)</p><p>&nbsp; &nbsp; &nbsp; &nbsp; IF ( bClose ) THEN<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !--- Then close the second window<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CALL closewindow(timerscreen)<br />&nbsp; &nbsp; &nbsp; &nbsp; ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; !--- Don&#039;t close the window.<br />&nbsp; &nbsp; &nbsp; &nbsp; ENDIF</p><p>&nbsp; &nbsp; &nbsp; &nbsp; RETURN</p><p>&nbsp; &nbsp; End Subroutine SplashScreen<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; Subroutine InitializeScreen()&nbsp; ! ============ InitializeScreen()<br />use appgraphics<br />character * 30 :: msg2<br />integer :: start_button<br />msg2 = &quot;In InitializeScreen()&nbsp; &nbsp; &quot;<br />myscreen = initwindow(400, 200, title=&quot;Controls Demo&quot;, closeflag=.TRUE.)<br />! call setbkcolor(systemcolor(COLOR_WINDOW_BKGD))<br />call setbkcolor(WHITE)<br />call clearviewport()&nbsp; ! to display the windows background color<br />call dlgmessage(DIALOG_INFO,msg2)</p><p>!call btnTest&nbsp; ! and it executes as expected&nbsp; but<br />! Comment out the above line and the build fails</p><p>start_button = createbutton(100, 200,120,50,&quot;Button Test&quot;, handle_button1)<br />call enablebutton(start_button, .FALSE.)</p><p>End Subroutine InitializeScreen<br />&nbsp; &nbsp; !--------------------------------------------------------/\<br />&nbsp; &nbsp; !--------------------------------------------------------/\<br />end program test</p>]]></content>
			<author>
				<name><![CDATA[tklfranklin]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3663</uri>
			</author>
			<updated>2016-02-18T13:41:17Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2372#p2372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2371#p2371" />
			<content type="html"><![CDATA[<p>I don&#039;t see anything wrong with your code snippet as-is.&nbsp; Could you post the entire program here so I can see if something is wrong?</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2016-02-17T21:23:33Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2371#p2371</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2370#p2370" />
			<content type="html"><![CDATA[<p>I&#039;m newby to this forum and do not find a formal way to post so I&#039;m giving this a try. <br />Subject: create button<br />Problem: multiple buttons in window<br />Description: I can create a single button just fine but when I do a second button (in the same way) the window appears quickly and then closes. Is there problem with multiple buttons? If not, I&#039;m missing something??<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; mybutton1 = createbutton(70, 410, 120, 120, &quot;Win 1&quot;, handle_button1)<br />&nbsp; &nbsp; &nbsp;mybutton2 = createbutton(270, 410, 120, 120, &quot;Win 2&quot;, handle_button2)</p><p>&nbsp; &nbsp; subroutine handle_button1()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p><p>&nbsp; &nbsp; end subroutine handle_button1</p><p>&nbsp; &nbsp; &nbsp;subroutine handle_button2()<br />&nbsp; &nbsp; use appgraphics, only: stopidle<br />&nbsp; &nbsp; implicit none</p><p>&nbsp; &nbsp; &nbsp; &nbsp; task = task_quit<br />&nbsp; &nbsp; &nbsp; &nbsp; call stopidle()</p>]]></content>
			<author>
				<name><![CDATA[tklfranklin]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=3663</uri>
			</author>
			<updated>2016-02-17T16:25:11Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2370#p2370</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AppGraphics and Multiple Windows]]></title>
			<link rel="alternate" href="http://forums.approximatrix.com/viewtopic.php?pid=2132#p2132" />
			<content type="html"><![CDATA[<p>Finally we have a tutorial upon managing a multiple window applications in Appgraphics:</p><p><a href="https://approximatrix.wordpress.com/2015/06/26/multiple-windows-appgraphics/">https://approximatrix.wordpress.com/201 … pgraphics/</a></p><p>With multiple windows, we&#039;re starting to wade into the world of non-trivial AppGraphics examples.&nbsp; This writeup might be&nbsp; substantially more complex that earlier examples.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>http://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2015-06-26T16:27:51Z</updated>
			<id>http://forums.approximatrix.com/viewtopic.php?pid=2132#p2132</id>
		</entry>
</feed>
