[comp.sys.next] Interface Builder observations

glenn@heaven.woodside.ca.us (Glenn Reid) (02/15/91)

Interface Builder is an impressive piece of software, there is
no doubt.  But tonight I was struck by a number of peculiarities
that it has.  For example:

1.  It is the only program I've seen that draws outside its
    windows onto the rest of the screen (when you control-drag
    to make a connection).  How on earth does it do this?  It
    seems like it must be a hack; I haven't seen any support
    for it in the AppKit

2.  It is the only program I've seen that alters the look of its
    icon while it's in the dock (when you're in "test interface"
    mode it turns into a giant switch).  How on earth does it do
    this?  It seems like it too must be a hack.

3.  There are several features which are only accessible by holding
    down modifier keys, like control-dragging to connect or alt-
    dragging to increasing the number of items in a matrix--but
    these are not available through any other means (like menu items).
    Questionable practice in a user interface, although Workspace
    Manager uses this kind of "features" too (when creating symbolic
    links, forcing a move or a copy, etc.).

Also, a couple of minor bugs, while I'm on the subject:

4.  You can't type a copyright symbol for love or money into a
    text field in IB.  It doesn't seem to use the standard
    keyboard mapping from Preferences.

5.  The "Format" menu should really be the "Font" menu, according
    to the user interface guidelines.

Admittedly, the line-drawing paradigm that IB uses when you control-drag
to make a connection is very nice feedback, but overall it seems that
Interface Builder has a rather non-standard user interface and appears
to rely on things which are not supported by the AppKit, which I find
to be a bit ironic.

Anybody else have thoughts about this?

Glenn
-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)

pfkeb@ebnextk.SLAC.Stanford.EDU (Paul Kunz) (02/15/91)

In article <423@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes:


   2.  It is the only program I've seen that alters the look of its
       icon while it's in the dock (when you're in "test interface"
       mode it turns into a giant switch).  How on earth does it do
       this?  It seems like it too must be a hack.

Lots of program change their Icon while running.  Under 1.0 there was
even one in /NextDeveloper/Examples  called Clock.   In the network
archives, there's Eyecon.   Altho I haven't had to do  this myself,
I think I've run across how to do it when reading the documentation
of the Application Class.

jacob@gore.com (Jacob Gore) (02/15/91)

/ comp.sys.next / glenn@heaven.woodside.ca.us (Glenn Reid) / Feb 15, 1991 /
> 2.  It is the only program I've seen that alters the look of its
>     icon while it's in the dock (when you're in "test interface"
>     mode it turns into a giant switch).  How on earth does it do
>     this?  It seems like it too must be a hack.

What about Mail, FaxManager, Monitor?  (Then there's the recycler icon, but
I don't know if you can count Workspace Manager as an application...)

> 4.  You can't type a copyright symbol for love or money into a
>     text field in IB.  It doesn't seem to use the standard
>     keyboard mapping from Preferences.

I haven't tried it in 2.0, but in 1.0 you could, as long as your text field
was in Symbol font.  The problem was that text fields are monofont, and the
copyright symbol is in the Symbol font, even though it's accessible from
the Times/Helvetica/etc. keyboard.

> Admittedly, the line-drawing paradigm that IB uses when you control-drag
> to make a connection is very nice feedback, but overall it seems that
> Interface Builder has a rather non-standard user interface and appears
> to rely on things which are not supported by the AppKit, which I find
> to be a bit ironic.

Yeah, but the the flip side is that IB seems to drive the standards.  For
example, in 1.0 it was the only NeXT-shipped app that used inspector
panels.  Now they are used all over the place.

Jacob
--
Jacob Gore		Jacob@Gore.Com			boulder!gore!jacob

scott@erick.gac.edu (Scott Hess) (02/16/91)

In article <423@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us (Glenn Reid) writes:
   1.  It is the only program I've seen that draws outside its
       windows onto the rest of the screen (when you control-drag
       to make a connection).  How on earth does it do this?  It
       seems like it must be a hack; I haven't seen any support
       for it in the AppKit

Those lines are actually windows.  Same with the lines you get when
you resize windows (you said that only IB draws outside windows -
but how do the windows do it, eh?)  Looking closely into the
innards of the way windows are handled (read /usr/lib/NextStep/
windowPackage.ps) reveals that there are semi-standard ways of
requesting windows to use in this fashion.

How can you tell they're windows?  One - click on the line where it
goes over something else, and the click doesn't make it to the
window behind the lines.  Two - on a slower machine (either an '030
or a busy '040), you can often see that the lines get out of sync -
the end of one line moves, while the other sometimes isn't updated
quickly enough.  That is a clue that there're windows involved.

   2.  It is the only program I've seen that alters the look of its
       icon while it's in the dock (when you're in "test interface"
       mode it turns into a giant switch).  How on earth does it do
       this?  It seems like it too must be a hack.

Sure, it is a hack.  Lot's of apps do this.  Download my IconBounce
program from the archive sites to see how.  It's got a slight bug
in 2.0 where it doesn't erase the original icon correctly, but that's
not a big problem.

   4.  You can't type a copyright symbol for love or money into a
       text field in IB.  It doesn't seem to use the standard
       keyboard mapping from Preferences.

You need the symbol font availiable.  For a TextField, you simply
can't do that (you can only use one font).  You _can_ simulate it -
place a small TextField over a space left in the one behind it, 
change the font to Symbol for it, and put the copyright symbol
in there.

   5.  The "Format" menu should really be the "Font" menu, according
       to the user interface guidelines.

Depends.  Font should be under the Format menu as a submenu.  Since
the other stuff which belongs under the Format menu (Text, etc) doesn't
really belong in IB, the Font menu was promoted to be in the Format
menu.  Lot's of apps will do this.  Stuart should, but I couldn't
do it in NextStep1.0 (because it couldn't find the Font menu if I
renamed it Format), and I was too lazy to fix it in Stuart2.11 -
I also forgot, but that's besides the point.

Later,
--
scott hess                      scott@gac.edu
Independent NeXT Developer	GAC Undergrad
<I still speak for nobody>
"Tried anarchy, once.  Found it had too many constraints . . ."
"Buy `Sweat 'n wit '2 Live Crew'`, a new weight loss program by
Richard Simmons . . ."

dbrenner@sparta.weeg.uiowa.edu (Doug Brenner) (02/16/91)

In article <423@heaven.woodside.ca.us> glenn@heaven.woodside.ca.us
           (Glenn Reid) writes:
> 1.  It is the only program I've seen that draws outside its
>     windows onto the rest of the screen (when you control-drag
>     to make a connection).  How on earth does it do this?  It
>     seems like it must be a hack; I haven't seen any support
>     for it in the AppKit

I certainly don't know the answer to this, but I thought someone once
suggested the connection lines were actually very thin windows.  (You
can all start laughing and flaming at me now. :-)

aozer@next.com (Ali Ozer) (02/16/91)

In article <423@heaven.woodside.ca.us> Glenn C. Reid writes:
>Interface Builder is an impressive piece of software, there is
>no doubt.  But tonight I was struck by a number of peculiarities
>that it has.  For example:
>
>1.  It is the only program I've seen that draws outside its
>    windows onto the rest of the screen (when you control-drag
>    to make a connection).  How on earth does it do this?  It
>    seems like it must be a hack; I haven't seen any support
>    for it in the AppKit
>
>2.  It is the only program I've seen that alters the look of its
>    icon while it's in the dock (when you're in "test interface"
>    mode it turns into a giant switch).  How on earth does it do
>    this?  It seems like it too must be a hack.

Given that the only way to draw on the screen is in a window,
Interface Builder creates long, thin PLAINSTYLE windows to draw its 
lines. Perfectly legal. As far as drawing in the running application icon, 
Interface Builder does that by drawing in the window returned by the appIcon 
method of Application. Under 2.0 this window's borders are "protected" 
from the app, but otherwise the app is free to draw whatever it wants in 
the window, and it can even replace the content view.

These features of IB aren't hacks; they are based on public API in the
kit, so they're perfectly legal and available to all apps. You might
be calling them "hacks" because they are somewhat different as far as
NeXTstep UI paradigms go, however, they are justified: #1 turned out
to be the preferred way of making connections after many months of
pre-1.0 IB testing, during which time the way of creating connections
was changed several times, all based on user feedback. #2, drawing in
the running app icon, is used by various apps to indicate their status
(especially while hidden) --- Preferences, Mail, and some of the
examples all do this, for instance. What IB does is no different: It
changes its app icon to indicate that it's hidden in test mode.

>3.  There are several features which are only accessible by holding
>    down modifier keys, like control-dragging to connect or alt-
>    dragging to increasing the number of items in a matrix--but
>    these are not available through any other means (like menu items).
>    Questionable practice in a user interface, although Workspace
>    Manager uses this kind of "features" too (when creating symbolic
>    links, forcing a move or a copy, etc.).

The use of alt, cntl, shift, etc to modify mouse operations are
allowed under NeXTstep UI guidelines, but for "advanced" features that
extend the operation naturally performed by the mouse (in this case,
resize).  This seems to fit IB's use of these keys.  However, it's a
valid point that there should be some indication as to the operation
being performed --- IB should maybe change the cursor to indicate
what's happening (resize items, resize matrix, resize intercell
spacing, etc), or maybe have menu items or a bunch of radio buttons to
indicate what a mouse drag on the little knobs will do by default.
Then the keyboard shortcuts can be used to temporarily switch to another
operation. This would make these features more accessible to the new user
without slowing down the advanced user.

Ali, Ali_Ozer@NeXT.com

wjs@milton.u.washington.edu (William Jon Shipley) (02/16/91)

Glenn C. Reid ("That's Mr. PostScript, SIR, to You!") writes:
>[Interface Builder is keen, but...]
>1.  It is the only program I've seen that draws outside its
>    windows onto the rest of the screen (when you control-drag
>    to make a connection).  How on earth does it do this?

I was once told that IB does this by creating two new windows, one which
is 2 pixels wide and the other two pixels high, both opaque black.  It
then resizes and moves them as you move the cursor.  Yes, kind of a hack.

>2.  It is the only program I've seen that alters the look of its
>    icon while it's in the dock (when you're in "test interface"
>    mode it turns into a giant switch).  How on earth does it do
>    this?  It seems like it too must be a hack.

Jayson Adams shows how to do this in his "Acceptor" example
(/NextDeveloper/Examples/Acceptor).  Basically, he creates a new changeable
view, and calls:
  [[[NXApp appIcon] setContentView:appIconView] free]

>3.  There are several features which are only accessible by holding
>    down modifier keys[...]

Ugly stuff.

>5.  The "Format" menu should really be the "Font" menu, according
>    to the user interface guidelines.

And "File" should be "Document" or "Interface".

>Anybody else have thoughts about this?

I did.  One cute thing I noticed was the default App_main.m that IB creates
does a:
    NXApp = [Application new];
Naughty, naughty, bad, bad.

-william shipley

gessel@ilium.cs.swarthmore.edu (Daniel Mark Gessel) (02/19/91)

>    NXApp = [Application new];
>Naughty, naughty, bad, bad.

Somebody please explain why this is bad.

Dan
--
Daniel Mark Gessel
Internet: gessel@cs.swarthmore.edu
I do not speak (nor type) representing Swarthmore College.

glenn@heaven.woodside.ca.us (Glenn Reid) (02/20/91)

In article <423@heaven.woodside.ca.us> I wrote:

>Interface Builder is an impressive piece of software, there is
>no doubt.  But tonight I was struck by a number of peculiarities
>that it has.  For example:
> 
> [ examples deleted ]

I got more mail on this subject than anything I've posted to the
net in a long time :-)  Thanks to all of you for your helpful
messages.  I wanted to make a couple of followup comments.

First, it was pointed out by many of you that lots of program alter
their icons.  I guess I thought of interface builder as being
different only because it's a big "switch" that you're supposed to
click on to get the program back into its normal state.  Other apps
(like Mail, process monitors, etc) merely show extra information
in the icon, rather than making the icon itself into a control button.

Also, I guess I didn't make this very clear by the way I said "how on
earth do they do that?", but I wasn't actually interested in HOW so
much as in pointing out that the various things were a bit non-standard
for a program that was supposed to build standard interfaces.  Most
of the responses I got told me how it was done, and since many of
them were also posted, I don't need to recap them, I don't think.

I do maintain, however, that using very skinny windows to draw lines
across the screen is a subversion of the user interface principles,
even though it is quasi-supported, and, in the words of Ali Ozer,
"perfectly legal."  It is a very limited mechanism, since the windows
have to be rectangular, and it is very easy to abuse, and will be
abused if it is promoted as a reasonable practice.  I would rather see
it acknowledged that there are times when you simply must draw outside
your own windows, and to have that supported somehow by the AppKit.
Obviously interface builder needed it.  And the Workspace Manager uses
a technique like that when you drag an icon from one window to another
(it becomes a small window in the space between windows).  And now
Diagram! uses that same technique when dragging items from their palette
to the main window (theirs even manages to get some transparency
behind the objects, I assume by compositing the contents of the screen
behind the objects into the little window each time it is moved).

A good interface paradigm must be extended quickly enough to keep up
with the requirements of the software development community to keep
them (us) from inventing hacks to solve sticky problems.  This is
already happening, which I applaud (notice the new "setFloatingPanel"
method in the Panel class).  I merely wanted to point out a few more
instances where the "de facto" interfaces are stretching the
boundaries of the officially sanctioned interface guidelines, and it's
best to notice those things and comprehend them before they
proliferate too far.

-- 
 Glenn Reid				RightBrain Software
 glenn@heaven.woodside.ca.us		NeXT/PostScript developers
 ..{adobe,next}!heaven!glenn		415-851-1785 (fax 851-1470)