[comp.sys.next] 0.9 Interface Builder vs. Application Kit

jacob@gore.com (Jacob Gore) (06/24/89)

There are discrepancies between the Application Kit documentation and what
can be accessed through the Interface Builder.  For example, the class
browser does not show PopUpList at all, while the manual shows it as a
subclass of Menu.  Can PopUpLists be used in the IB?

A related question: what criteria are used in deciding in what goes into
the Views panel?  Are all AppKit classes supposed to be represented there?

ScrollView is documented as a general scrolling view, with optional
vertical and horizontal sliders and with any content view possible.  The IB
has on its Views palette an icon that looks like it's for scrolling text,
and the default instance variable name for it is ScrollingText, but the
Inspector window says "ScrollView Inspector", even though the Attributes
subpanel talks about text attributes.  Is ScrollingText a subclass of
ScrollView?  If so, why doesn't it show up as such in the Classes browser?
Can a regular ScrollView be used in the IB?

--
Jacob Gore	Jacob@Gore.Com		{oddjob,chinet,att}!nucsrl!gore!jacob

stone@unmvax.cs.unm.edu (Andrew Stone) (06/26/89)

In article <130003@gore.com> jacob@gore.com (Jacob Gore) writes:
>There are discrepancies between the Application Kit documentation and what
>can be accessed through the Interface Builder.  For example, the class
>browser does not show PopUpList at all, while the manual shows it as a
>subclass of Menu.  Can PopUpLists be used in the IB?

You can sort of use IB to create pop up lists.
I create a regular button as a temporary stand in, and 
set its target/action to a subclass I've written, and an
appropriate method. Create an outlet in this class and connect
it to the stand-in button. If the outlet is named "fontPopUp",
then IB creates a method -setFontPopUp:anObject which you
enhance like this:

- setFontPopUp:anObject
{   
    int i;
    FontPopUp = anObject;
    
    fontPopUpList = [PopUpList new];
    for (i=0;i<NUMFONTS;i++) [fontPopUpList addItem:FONTS[i]];
    NXAttachPopUpList(anObject,fontPopUpList);

    return self;
}

Basically, you build a list with the titles of your pop up items, 
and then connect it to the button with NXAttachPopUpList.

andrew

||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
!!	   Andrew Stone	            !!        the fictive milieu of	!!
!!         stone@hydra.unm.edu	    <> 	      contemporary society!	!!
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||

ali@polya.Stanford.EDU (Ali T. Ozer) (06/26/89)

In article <130003@gore.com> jacob@gore.com (Jacob Gore) writes:
>Can PopUpLists be used in the IB?

Not directly; the best way to use PopUpLists through IB is to create
a button and use NXAttachPopUpList() at runtime (a good way to do this
might be to make the button an outlet of something and attach the
PopUpList in the setOutletName: method).

>ScrollView is documented as a general scrolling view, with optional
>vertical and horizontal sliders and with any content view possible.  The IB
>has on its Views palette an icon that looks like it's for scrolling text,
>and the default instance variable name for it is ScrollingText, but the
>Inspector window says "ScrollView Inspector", even though the Attributes
>subpanel talks about text attributes.  Is ScrollingText a subclass of
>ScrollView? 

No, it's simply a ScrollView whose docView is set to an instance of the Text
class. IB doesn't yet provide the means to create a ScrollView whose
docView is an arbitrary view.

Ali Ozer, NeXT Developer Support
aozer@NeXT.com

mrc@Tomobiki-Cho.CAC.Washington.EDU (Mark Crispin) (06/26/89)

In article <10255@polya.Stanford.EDU> aozer@NeXT.com (Ali Ozer) writes:
>In article <130003@gore.com> jacob@gore.com (Jacob Gore) writes:
>>Can PopUpLists be used in the IB?
>
>Not directly; the best way to use PopUpLists through IB is to create
>a button and use NXAttachPopUpList() at runtime (a good way to do this
>might be to make the button an outlet of something and attach the
>PopUpList in the setOutletName: method).

Ali, NXAttachPopUpList() has a serious deficiency that makes it
difficult for a programer trying to work around the lack of IB support
for PopUpLists.  It requires a Button, and will not accept a
ButtonCell.  This is alright if you have a standalone button, but if
you have a Matrix of buttons, the outlet will give you a ButtonCell.

Of course, I've never reconciled myself to the existance of Cells; as
far as I can tell they exist only because Matrix was poorly designed.

Mark Crispin / 6158 Lariat Loop NE / Bainbridge Island, WA 98110-2020
mrc@CAC.Washington.EDU / MRC@WSMR-SIMTEL20.Army.Mil / (206) 842-2385
Atheist & Proud / 450cc Rebel pilot -- a step up from 250cc's!!!
tabesaserarenakerebanaranakattarashii...kisha no kisha ga kisha de kisha-shita
sumomo mo momo, momo mo momo, momo ni mo iroiro aru
uraniwa ni wa niwa, niwa ni wa niwa niwatori ga iru