[comp.sys.mac.programmer] Scrolling Lists In Dialogs

alistair@minster.york.ac.uk (02/17/89)

I have a friend (honest - not me!) who has a problem.  He is trying to write
a program which will involve making selections from scrollable lists - rather
like the Font/DA mover (NOT files).  He wonders whether any kind person out
there has any suitable code lying around which they might be willing to
share. Please.

summer@atreides.trl.oz.au (Mark Summerfield) (12/11/90)

I am about to return to Mac programming for a short while after a year
doing other things (arrgh!) to make a few mods to a program I wrote.
Basically the changes involve adding some AppleTalk networking features.
Now I've looked at what I need to do with the AT manager, and *that*
doesn't seem to be a major problem, however one of the things I am
going to need is a dinky little scrolling dialog box showing all the
other machines on the network providing my service (like the ones the
chooser has for selecting zones and printers).

What I want to know is: is there a standard way of easily implementing
one of these things, or do you have to do everything yourself (run the
control, scroll the list, check which item gets selected etc etc)? The
standard file package does this for you for file selection. Is there
something similar for AppleTalk, or for general lists of items?

Please e-mail any replies, as our inbound newsfeed is currently poor
(bordering on non-existent).

Thanks very much to anyone who can help.

Mark.
------------------------------------------------+-----------------------------+
Mark Summerfield, Telecom Research Laboratories |     Heisenberg may have     |
ACSnet[AARN/Internet]: m.summerfield@trl.oz[.au]|         been here!          |
Snail: PO Box 249, Clayton, Vic., 3168          +-----------------------------+

rfl@oddjob.uchicago.edu (Bob Loewenstein) (12/11/90)

TN 203 has some rules of thumb for using (and not using) the dialog
manager:

If there are more than 20 items in the dialog it should be a standard window.
If a complicated control like a scroll bar is needed, it should be a
  standard window.
If there are items offscreen, it should be a standard window.
If there is a pictorial indicator like a progress indicator, it should
  be a standard window.
If it is a  modeless dialog, it should be a standard window.
If any of the items are movable in the dialog, it should be a standard
  window.
If it is necessary to use a filterProc to add functionality, it should
  be a standard window.
[ it finishes with ]
If in doubt, it should probably be a standard window.

The thrust of the TN is that the DM is great for simple functions, but
for more complex functionality, do it with the WM...more code to write,
possibly, but less complex code than with the DM.

siegel@endor.uucp (Rich Siegel) (12/12/90)

In article <1990Dec11.144800.22863@midway.uchicago.edu> rfl@oddjob.uchicago.edu (Bob Loewenstein) writes:

>TN 203 has some rules of thumb for using (and not using) the dialog
>manager:

	Technote 203 says lots of things, many of which are valid (e.g
"TextEdit is not a wordprocessor"), and many of which are not - I refer
specifically to the "guidelines" with respect to using the Dialog Manager.

	I invite the authors of this tech note to provide some rationale
behind their guidelines not to use the Dialog Manager in what are currently
some very valid circumstances (e.g. scrolling lists, progress indicators,
and filter procs). No justification for the guidelines is given, consequently
the technote reads: "The dialog manager is a really neat set of routines
for structured management of user-interface elements; it handles most 
common events for you, and allows you to hook into it in many useful
and convenient ways, but don't use it."

	I understand that in MacApp, modal dialogs and alerts *are* managed
using windows and views, but the world doesn't yet use MacApp, and there's
a large body of existing code that wasn't written using MacApp.

R.



 Rich Siegel	Symantec Languages Group  Internet: siegel@endor.harvard.edu

"...she's dressed in yellow, she says 'Hello, come sit next to me, you
fine fellow..."

pepke@gw.scri.fsu.edu (Eric Pepke) (12/13/90)

Two things:

1) The piece of code you are looking for is the List Manager.  It is 
documented in IM-IV.  Some programmers have difficulty determining how to 
use it from the description.  For them there is an entire chapter in the 
USENET Macintosh Programmer's Guide.

2) I agree wholeheartedly with Rich Siegel about dialogs.  I think they 
work great, even with a modicum of complexity.  I wouldn't use them for 
sizeable windows or moveable items, but for scrolling lists, progress 
indicators, complex controls in UserItems, they work just fine.  They have 
two really big advantages.  The first is that they automatically deal with 
small text entry fields.  The second is that the layout is defined by 
resources.

Eric Pepke                                    INTERNET: pepke@gw.scri.fsu.edu
Supercomputer Computations Research Institute MFENET:   pepke@fsu
Florida State University                      SPAN:     scri::pepke
Tallahassee, FL 32306-4052                    BITNET:   pepke@fsu

Disclaimer: My employers seldom even LISTEN to my opinions.
Meta-disclaimer: Any society that needs disclaimers has too many lawyers.

marty@cernvax.cern.ch (hugues marty) (12/13/90)

In article <1661@sun13.scri.fsu.edu> pepke@gw.scri.fsu.edu (Eric Pepke) writes:
>Two things:
>
>1) The piece of code you are looking for is the List Manager.  It is 
>documented in IM-IV.  Some programmers have difficulty determining how to 
>use it from the description.  For them there is an entire chapter in the 
>USENET Macintosh Programmer's Guide.

Where do you get this guide ?

tnx.
-- 
 e+ ----> {:-) <---- e-                         e-mail :
 Les Chercheurs de Bosons Unifies               marty@cernvax.cern.ch

roy@phri.nyu.edu (Roy Smith) (12/13/90)

pepke@gw.scri.fsu.edu (Eric Pepke) writes:
> there is an entire chapter in the USENET Macintosh Programmer's Guide.

	How does one go about getting said document.  Sounds like it might
be increadibly useful.

> [Dialogs] have two really big advantages [...] The second is that the
> layout is defined by resources.

	What is to prevent you from making a dialog-ish window using the
Window Manager, as suggested in TN-203, but using ResEdit to layout an
analagous dialog and then read the DLOG/DITL resource(s) to build your own
window?
--
Roy Smith, Public Health Research Institute
455 First Avenue, New York, NY 10016
roy@alanine.phri.nyu.edu -OR- {att,cmcl2,rutgers,hombre}!phri!roy
"Arcane?  Did you say arcane?  It wouldn't be Unix if it wasn't arcane!"

Bruce.Hoult@bbs.actrix.gen.nz (12/13/90)

Rich Siegel writes:

>I understand that in MacApp, modal dialogs and alerts *are* managed
>using windows and views

You forgot *modeless* dialogs...  Er, and I think MacApp uses the standard
mechanism for alerts.

-- Bruce

-- 
Bruce.Hoult@bbs.actrix.gen.nz   Twisted pair: +64 4 772 116
BIX: brucehoult                 Last Resort:  PO Box 4145 Wellington, NZ

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (12/13/90)

Mark Summerfield writes in a message to All

MS> however one of the things I am going to need is a dinky little 
MS> scrolling dialog box showing all the other machines on the network 
MS> providing my service (like the ones the chooser has for selecting 
MS> zones and printers). 
MS> What I want to know is: is there a standard way of easily implementing 
MS> one of these things, or do you have to do everything yourself 
MS> (run the control, scroll the list, check which item gets selected 
MS> etc etc)?

Look at the List Manager routines in Inside Mac Vol IV, page 260 on. They 
implement
a simple text lister ala the File Manager (I believe that the File Manager USES
the List Manager). The main lack is a way to (easily) draw 'n' scroll leetle
beety ICONS.

Lawson
 

 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org

bin@primate.wisc.edu (Brain in Neutral) (12/14/90)

From article <3564@cernvax.cern.ch>, by marty@cernvax.cern.ch (hugues marty):
>>use it from the description.  For them there is an entire chapter in the 
>>USENET Macintosh Programmer's Guide.
> 
> Where do you get this guide ?

ftp sumex-aim.stanford.edu, in ~ftp/info-mac/tech.  Two binhex files
in Word format.  It's mighty long, and well worth reading.
--
Paul DuBois
dubois@primate.wisc.edu

       "If you're not a docter, you're just pants" -- Ian D., age 3 1/2

merk@aerospace.aero.org (Karl G. Merkley) (12/14/90)

The USENET Macintosh Programmer's Guide sounds like a useful
tool.  Where can I find it?

			Karl Merkley
			The Aerospace Corp.

jbr0@cbnews.att.com (joseph.a.brownlee) (12/14/90)

In article <1990Dec12.185909.16488@phri.nyu.edu>, roy@phri.nyu.edu (Roy Smith)
writes:
> pepke@gw.scri.fsu.edu (Eric Pepke) writes:
> > [Dialogs] have two really big advantages [...] The second is that the
> > layout is defined by resources.
> 
> 	What is to prevent you from making a dialog-ish window using the
> Window Manager, as suggested in TN-203, but using ResEdit to layout an
> analagous dialog and then read the DLOG/DITL resource(s) to build your own
> window?

Good idea.  This would solve a problem I've been having.  Before I dive into
this, has anyone already written something like this?  If so and you're not
willing/able to share the code itself, I would be grateful for any advice you
might give or any warnings regarding potential problems in doing this.

-- 
   -      _   Joe Brownlee, Analysts International Corp. @ AT&T Network Systems
  /_\  @ / `  471 E Broad St, Suite 1610, Columbus, Ohio 43215   (614) 860-7461
 /   \ | \_,  E-mail: jbr@cblph.att.com     Who pays attention to what _I_ say?
 "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk

mxmora@unix.SRI.COM (Matt Mora) (12/15/90)

Now that Macworld Expo is coming up in January in S.F., would anybody be
interested in picking up a copy at MacWorld Expo? I'm going to be there
all 3 or 4 days and would be happy to meet you netfolk somewhere and distribute
some copies. Let me know what you think.

Matt Mora

Below is a posting about the UMPG.


---
This is a posting about our now famous guide. :-)

What the heck is the UMPG?

The UMPG is the USENET Macintosh Programmers Guide. It is a compilation
of postings that have appeared in this news group and articles written
by the top Macintosh programmers of our time. This is the first place you
should look if you have a question about programming the Macintosh.

Where can I get the darn thing?

You can get the Word 4.0 formatted version via FTP from sumex-aim.stanford.edu.
You will find by using the path below:

[Archived as /info-mac/tech/usenet-mac-prog-guide-part1.hqx; 291K
             /info-mac/tech/usenet-mac-prog-guide-part2.hqx; 291K]

If you can't FTP you can e-mail me and I will send you a copy. Be fore
warned that your mailer must be able to handle big messages.

Its also on the Beta 7.0 CD. It should be on the next Developer CD as well.

Also the guide is very large and takes a long time to print. Its
about 290 pages long and uses up a ream of paper when printed. Then
you have to bind it in some way. To save you from all that trouble
I made up some books in printed form already. The printed version is
double sided and spiral/comb (each copy place calls it different) bound.

You can get the printed version by sending $17.00 to:

USENET Macintosh Programmers Guide
Printed Version
39075 Carmel ct.
Fremont, CA 94538

If you wanted to get the Guide on disk you can send $5.00 to:

USENET Macintosh Programmers Guide
Disk Version
39075 Carmel ct.
Fremont, CA 94538


Please make the checks payable to: Matthew Mora


Version II of the guide is scheduled to start production some
time in January. So start working on your articles Now! :-)



-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (12/16/90)

Rich Siegel writes in a message to All

RS> I understand that in MacApp, modal dialogs and alerts *are* managed 
RS> using windows and views, but the world doesn't yet use MacApp, 
RS> and there's a large body of existing code that wasn't written 
RS> using MacApp

I noticed that the "About Box" for the Art Class sample uses a window instead
of a modal dialogue. As this was a very complex sample, which used objects,
I could see why it was needed. However, there is no generic "Modal Dialogue
window class" provided, just the CAboutBox class, which is commented with 
words
like "dirty," "hairy," etc. Will the TCL's eventually include a 
well-documented
CModalDialgue class, or will we be stuck with Clint Eastwood?


Lawson
 

 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org

Jim.Lynch@f444.n161.z1.FIDONET.ORG (Jim Lynch) (01/02/91)

> Subj: SCROLLING LISTS IN DIALOGS
> From: summer@atreides.trl.oz.au (Mark Summerfield)
> Date: 11 Dec 90 06:14:12 GMT
> Organization: Telecom Research Laboratories, Melbourne, Australia
> Message-ID: <2535@trlluna.trl.oz>
> Newsgroups: comp.sys.mac.programmer
> 
> I am about to return to Mac programming for a short while
> after a year doing other things (arrgh!) to make a few mods
> to a program I wrote.  Basically the changes involve adding
> some AppleTalk networking features.  Now I've looked at what
> I need to do with the AT manager, and *that* doesn't seem
> to be a major problem, however one of the things I am going
> to need is a dinky little scrolling dialog box showing all
> the other machines on the network providing my service (like
> the ones the chooser has for selecting zones and printers).
> 
> What I want to know is: is there a standard way of easily
> implementing one of these things, or do you have to do
> everything yourself (run the control, scroll the list,
> check which item gets selected etc etc)? The standard file
> package does this for you for file selection. Is there
> something similar for AppleTalk, or for general lists of items?
> 

Yes, there is but I only know its name.  It's called the List Manager
and is described in Inside Macintosh vol. four.

> 
> Please e-mail any replies, as our inbound newsfeed is currently
> poor (bordering on non-existent).
> 

Could someone e-mail this reply to him?  I can't.  TNX in advance.

> 
> Thanks very much to anyone who can help.
> 
> Mark.
> ------------------------------------------------+-------------------------- +
> Mark Summerfield, Telecom Research Laboratories |    Heisenberg may have  
|
> ACSnet[AARN/Internet]: m.summerfield@trl.oz[.au]|        been here!       
|
> Snail: PO Box 249, Clayton, Vic., 3168          +-------------------------- +

/*********************************************************************/
/* Jim Lynch                           on BMUG BBS in Berkeley, CA   */
/*                                        (415) 849-BMUG             */
/*                                     or leave a voice message at:  */
/*                                        (415) 521-7367             */
/*********************************************************************/


--  
Jim Lynch - via FidoNet node 1:125/777
    UUCP: ...!uunet!hoptoad!fidogate!161!444!Jim.Lynch
INTERNET: Jim.Lynch@f444.n161.z1.FIDONET.ORG

tim@hoptoad.uucp (Tim Maroney) (01/05/91)

>> From: summer@atreides.trl.oz.au (Mark Summerfield)
>> some AppleTalk networking features.  Now I've looked at what
>> I need to do with the AT manager, and *that* doesn't seem
>> to be a major problem, however one of the things I am going
>> to need is a dinky little scrolling dialog box showing all
>> the other machines on the network providing my service (like
>> the ones the chooser has for selecting zones and printers).
>> 
>> What I want to know is: is there a standard way of easily
>> implementing one of these things, or do you have to do
>> everything yourself (run the control, scroll the list,
>> check which item gets selected etc etc)? The standard file
>> package does this for you for file selection. Is there
>> something similar for AppleTalk, or for general lists of items?

The Chooser will do this for you, if you're writing a Chooser device.
See Inside Macintosh.

If you want to do it oustide the Chooser, them yes, you need to do
the user interface code yourself, but it's not hard with the List
Manager if you already have a handle on the NBP calls to use.
-- 
Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com

"I am of the opinion that my life belongs to the whole community, and as long
 as I live it is my privilege to do for it whatever I can." -- Shaw