[futurebasic] Building window invisibly

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 23 Dec 1997 19:04:29 -0400
Question 1:

I'm sure this has been addressed before, but could someone help me
understand the concept of building a window invisibly. On Page 81, the
Handbook says to make a window invisible, you change the ID to negative,
and then restore it to positive to make it visible again. I have done this
in the example below, but the window contents are gone when the positive ID
is restored.

I have a splash screen calling a PICT resource that I would like to build
invisibly on launch before it's displayed, but I can't get the thing to
work in the background.

'-------------- Begin Program ---------------

COORDINATE WINDOW
EDIT = 5
'-------------- Functions -------------------
LOCAL FN buildWindow
  WINDOW #-1,"Invisible Window Test",(0,0)-(400,250),_doc'I thought
negative ID builds window invisibly
  EDIT FIELD #1, "Please help me build this window
invisibly!",(50,50)-(350,65),_statFramed,_centerJust
  EDIT FIELD #2, "This is giving me a major
pain.",(50,85)-(350,100),_statFramed,_centerJust
  EDIT FIELD #3, "Any and all help is
appreciated.",(50,125)-(350,140),_statFramed,_centerJust
  EDIT FIELD #4, "I have faith.",(50,160)-(350,175),_statFramed,_centerJust
  WINDOW #1                                       'I though setting ID back
to positive made it visible
END FN

'-------------- Main ------------------------
WINDOW OFF
FN buildWindow

DO
UNTIL FN BUTTON
'-------------- End Program -----------------

Question 2:

Has anyone been able to get Exercise 18.3 on Page 114 in "Programming The
Macintosh with FB II" to work? I finally gave up and was able to come up
with the following code to call my PICT resource (ID 128). But before I
give up, I want to make sure I'm not missing something.

Note to Staz: The arrows in my book obscure some important parts of the
code-- an underline at the FN GETRESOURCE(_"PICT", pictNum), and a comma at
the PICTURE (0,0), myPict&.

Here's my work-around code:

LOCAL FN splashScreen

  WINDOW #1,"",(0,0)-(360,215),-_dialogFrame

  splashScreen& = FN GETPICTURE(128)
  PICTURE (0,0), splashScreen&

END FN

I'm concerned if I had more resources than just one, would this continue to
work.

Your thoughts will be appreciated.


___________________________________________________________________
Ken Shmidheiser                     Systems Administrator/Publisher

Internet: kshmidheiser@...    Fax:  606.878.7400
Somerset, KY 42502-0221                        Phone:  606.679.4266
___________________________________________________________________