' Checking out the graphics capabilitiess of cc4.04 and I'm having a
' couple of problems. The following code is what I have now.
'
' 1. I want the graphics window to have a solid back background.
' When I REM out the #CONSOLE OFF statement, things go as
' expected. When I unREM the statement, the graphics window
' stays grey about 50 percent of the time and black the other
' 50 percent
'
' 2. When I REM out the #CONSOLE OFF statement, I click the 'X'
' on the console window, the program ends and I keep on
' debugging. With #CONSOLE OFF active, I have to click the
' 'X' on the graphics window. The program seems to end but
' I have to bring up windows task manager, find it there and
' "End Task" before I continue debugging.
'
' I remember reading that problem #2 has been discussed before
' but I can't find it.
'
' Fixes anybody?
'
'
' couple of problems. The following code is what I have now.
'
' 1. I want the graphics window to have a solid back background.
' When I REM out the #CONSOLE OFF statement, things go as
' expected. When I unREM the statement, the graphics window
' stays grey about 50 percent of the time and black the other
' 50 percent
'
' 2. When I REM out the #CONSOLE OFF statement, I click the 'X'
' on the console window, the program ends and I keep on
' debugging. With #CONSOLE OFF active, I have to click the
' 'X' on the graphics window. The program seems to end but
' I have to bring up windows task manager, find it there and
' "End Task" before I continue debugging.
'
' I remember reading that problem #2 has been discussed before
' but I can't find it.
'
' Fixes anybody?
'
'
Code:
#COMPILE EXE #CONSOLE OFF ' col row text DECLARE FUNCTION PrintString(LONG, LONG, STRING) AS STRING DECLARE SUB ShowMouse FUNCTION PBMAIN () AS LONG LOCAL hGw AS LONG MOUSE ON MOUSE 3, DOUBLE, DOWN fnt$ = "ocr-a bt" hGw = FREEFILE '<---------------Just checking GRAPHIC WINDOW "Graphic Test Program", 50, 500, 750, 500 TO hGw ' Over Down | Wide Deep ' Opening | In pixels ' position | ' on console | GRAPHIC ATTACH hGw, 0 ' Make the entire window a black background GRAPHIC BOX (0,0) - (750,500),0, %BLACK , %BLACK ,0 GRAPHIC COLOR RGB( 255, 153, 0), %BLACK GRAPHIC FONT fnt$, 20,0 printstring( 0, 30,fnt$) PrintString( 0, 0, "ABCDEFG") GRAPHIC REDRAW DO WHILE INSTAT = 0 showmouse WEND an$ = INKEY$ IF an$ = CHR$(27) THEN EXIT LOOP LOOP END FUNCTION SUB ShowMouse PrintString(700,425,STR$(MOUSEX)) PrintString(700,450,STR$(MOUSEY)) END SUB FUNCTION PrintString(col AS LONG, row AS LONG, txt AS STRING ) AS STRING GRAPHIC SET POS ( col, row ) ' Same as LOCATE ROW,COL except this is COL, ROW GRAPHIC PRINT txt$ END FUNCTION '
Comment