[futurebasic] White Dot on Refresh problem

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: scram@... (Stu Cram)
Date: Tue, 22 Jun 1999 08:28:21 -0700
You have created output in your window before the FB's event handler
routine has had a chance to update the window once. HandleEvents makes an
initial invalid regionthat is just a small rect (0,0)-(0,0).
By blackening the window first and later using HandleEvents, the window's
invalid region is updated, in this case making your small white dot.

Some Solutions:
1. Set the background colour to black and just clear the screen:
       COLOR , zBlack
       CLS

2. Use HandleEvents once just before calling FN DrawTest
   not inside the the function.

3. Call FN DrawTest only as the result of a window refresh event.
   I recommend this as the best method. It allows the window's
   contents to be redrawn after being covered by another window.

   - Here is a new version that includes an extra item in the
   window too. You can add whatever else you need to show.

'--------------------------------------

LOCAL FN DrawTest
  DIM rect.8
  CALL SETRECT(rect,0,0,400,300)
  LONG COLOR 0,0,0                 ' set to black
  CALL PAINTRECT(rect)
  COLOR 0 : PEN 1,12
  CIRCLE 100,100,24                ' make an eye ball
END FN
'--------------------------------------

LOCAL FN doDialog
  evt = DIALOG(0)
  id  = DIALOG(evt)
  SELECT evt
    CASE _wndRefresh  : FN DrawTest
    CASE _wndClose    : END
    CASE _btnClick    : END
  END SELECT
END FN
'--------------------------------------

WINDOW 1,"Test",(0,0)-(400,300),5         'test window

ON DIALOG FN doDialog

DO
  HANDLEEVENTS
UNTIL forever
==========================================

- Hope this helps

Stu Cram, Regina, SK CAN