The GRAPHIC SET FOCUS is (according to the help file) supposed to bring the selected graphic window to the foreground, and set focus to it. But it seems that, while it DOES set focus to the graphics window (as opposed to the console window), it does NOT bring the specific graphic window to the foreground, on top of other graphic windows. Only after drawing to the window (any drawing) does it then get set to the foreground. You don't have to REDRAW the whole window, just setting a pixel will do it (although that would create an undesirable artifact).
Here's a little test routine that shows it:
If a graphic window will come to the foreground automatically with ANY drawing to it, then why won't it do so with just the GRAPHIC SET FOCUS command, so that I don't have to output something to it to get it to come forward (or REDRAW the whole window)?
Thanks.
Here's a little test routine that shows it:
Code:
#COMPILE EXE FUNCTION PBMAIN () AS LONG DIM MyWindow???(10) CONSOLE SET SCREEN 10, 20 CONSOLE SET LOC -1000, -1000 FOR count% = 1 TO 10 GRAPHIC WINDOW "", 10, 10, 1000, 1000 TO MyWindow???(count%) GRAPHIC ATTACH MyWindow???(count%), 0 Background& = RGB(RND(0,255), RND(0,255), RND(0,255)) GRAPHIC CLEAR Background& GRAPHIC COLOR RGB(255, 255, 255), Background& GRAPHIC SET POS (440, 500) GRAPHIC PRINT "This is window ";count% GRAPHIC SET POS (440, 520) GRAPHIC PRINT "Press any key for next window" GRAPHIC SET POS (440, 540) GRAPHIC PRINT "Press 'e' to end" NEXT DO FOR count% = 1 TO 10 GRAPHIC ATTACH MyWindow???(count%), 0 GRAPHIC SET FOCUS GRAPHIC SET PIXEL (1, 1), RGB(255, 255, 255) 'Should still work without this line 'REM it out to test DO CONSOLE SET FOCUS I$ = INKEY$ LOOP UNTIL I$ <> "" IF I$ = "e" OR I$ = "E" THEN END NEXT LOOP END FUNCTION
If a graphic window will come to the foreground automatically with ANY drawing to it, then why won't it do so with just the GRAPHIC SET FOCUS command, so that I don't have to output something to it to get it to come forward (or REDRAW the whole window)?
Thanks.
Comment