[comp.sys.mac.programmer] Chooser Interface Problem

tomj@oakhill.UUCP (Tom Johnson) (06/06/89)

I'm having a little problem writing an RDEV.  As an (almost) last resort
prior to tearing my hair out and becoming a Buddist monk, I though I might
see whether anyone out in netland has a solution.

Scenario:
  RDEV which issues its own NBP call to fill a list.

RDEV Header info as per IM-IV (pg. 217):
 0 - BRA.s to offset $10
 2 - Device ID word (0)
 4 - 'PACK' long word
 8 - $F000 (-4096)
 A - Version word (1)
 C - Flags long word (see below)
10 - Start of driver code

Flag long word = 9D008800
  (AppleTalk device, multiple instances allowed, uses left & right buttons,
   doesn't use radio buttons, saves zone names, uses actual zone name,
   no initMsg, no newSel msg, uses fillList msg, no getSel msg, no select msg,
   no deselect msg, uses terminate msg)

Resources:
   'PACK' -4096 (the header described above + code)
   'STR ' -4096 (Type name = "NetAlert")
   'GNRL' -4096 ($0803 = timeout/retry info for NBP call)
   'STR ' -4093 (Left Button title)
   'STR ' -4092 (Right Button title)
   'STR ' -4091 (List label)
   'STR ' -4090 (empty string - for chooser's use)
   'BNDL' -4065 (bundle info)

The Problem:
  Regardless of the setting of the flags long word, the code NEVER receives
a "fillList" message as per IM-IV p.220, and ALWAYS receives a getSel msg!

I have tries removing the STR -4096 resource and the GNRL -4096 resource.
Under these circumstances, the chooser STILL insists in filling the list
for me, and thinks I want the names of the LaserWriters!  I tried clearing
the AppleTalk device bit in the flags long word...still get GetSel messages,
and STILL getting list filled for me.

Question:
  How in the H**L do I get Chooser to 1) NOT send me getSel messages and send
me a fillList message instead?  2) NOT issue the NBP call for me?

There is a questionable passage in IM-IV p.218 where it says:
"When the Chooser sends the fillList message, the device package should fill
a List Manager list **FILLED WITH CHOICES FOR A PARTICULAR DEVICE**..."
(emphasis is mine).  What does this mean exactly?

On page 220, IM says (point 4 after icon selection):
"If the device accepts fillList messages, the Chooser calls the device package
which should fill column 0 of the list pointed to by p1 (actually a handle)..."
This NEVER occurs?  Why?

HHHHHHHEEEEEEELLLLLLLPPPPPP!!!!!!!!!!

p.s. I am writing this thing in assembly.  Everything works except for the
missing FillList call.  I decided to add this since there is a limit on
the number of tuples which the default NBP call will handle (15 I think).

tomj

tappan@bbn.com (Dan Tappan) (06/06/89)

In article <2094@oakhill.UUCP> tomj@oakhill.UUCP (Tom Johnson) writes:
>I'm having a little problem writing an RDEV.  As an (almost) last resort
>prior to tearing my hair out and becoming a Buddist monk, I though I might
>see whether anyone out in netland has a solution.
>
>Scenario:
>  RDEV which issues its own NBP call to fill a list.
> ...
>The Problem:
>  Regardless of the setting of the flags long word, the code NEVER receives
>a "fillList" message as per IM-IV p.220, and ALWAYS receives a getSel msg!

What you may be running into is that the Chooser caches the flag settings from
RDEV's. There is a resource in the system file called 'clst'.

The effect of this is that if you built your RDEV the first time without that
bit set then forever afterword the Chooser will ignore your new setting.

scott@Apple.COM (scott douglass) (06/11/89)

In article <40981@bbn.COM> tappan@BBN.COM (Dan Tappan) writes:
-In article <2094@oakhill.UUCP> tomj@oakhill.UUCP (Tom Johnson) writes:
->I'm having a little problem writing an RDEV.
-> ...
->The Problem:
->  Regardless of the setting of the flags long word, the code NEVER receives
->a "fillList" message as per IM-IV p.220, and ALWAYS receives a getSel msg!
-
-What you may be running into is that the Chooser caches the flag settings from
-RDEV's. There is a resource in the system file called 'clst'.
-
-The effect of this is that if you built your RDEV the first time without that
-bit set then forever afterword the Chooser will ignore your new setting.

The use of "forever" is a bit strong.  The Chooser (and similarly Control
Panel) does cache some information (including, in the Chooser case, the
'PACK' flags).  The cache is validated by file creation date.  If you
replace the file with a freshly created one the Chooser will see the new
flags.  There is also a way to force the cache to be rebuilt (just for
all you RDEVers out there).  If you hold down cmd and option together
while opening the Chooser (or Control Panel) it will beep (to let you know
you can let go now) and rebuild the cache from scratch.

I hope this helps,
		--scott douglass
Any opinions above may be mine and are not necessarily those of Apple Computer.
domain: scott@apple.com  UUCP: {nsc, sun, voder, well, dual}!apple!scott
CSNet: scott@Apple.CSNet  AppleLink: Douglass1
				--scott douglass
Any opinions above may be mine and are not necessarily those of Apple Computer.
domain: scott@apple.com  UUCP: {nsc, sun, voder, well, dual}!apple!scott
CSNet: scott@Apple.CSNet  AppleLink: Douglass1