[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 ---------------

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
  EDIT FIELD #2, "This is giving me a major
  EDIT FIELD #3, "Any and all help is
  EDIT FIELD #4, "I have faith.",(50,160)-(350,175),_statFramed,_centerJust
  WINDOW #1                                       'I though setting ID back
to positive made it visible

'-------------- Main ------------------------
FN buildWindow

'-------------- 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&


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

Your thoughts will be appreciated.

Ken Shmidheiser                     Systems Administrator/Publisher

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